teeworlds_network/lib/snapshot/items/game_data.rb

24 lines
471 B
Ruby
Raw Normal View History

2022-11-18 08:25:08 +00:00
# frozen_string_literal: true
2022-11-19 09:09:45 +00:00
require_relative '../snap_item_base'
2022-11-18 08:25:08 +00:00
class NetObj
2022-11-19 09:09:45 +00:00
class GameData < SnapItemBase
2022-11-18 08:25:08 +00:00
attr_accessor :game_start_tick, :game_state_flags, :game_state_end_tick
def initialize(hash_or_raw)
2024-02-21 06:44:49 +00:00
@type = NETOBJTYPE_GAMEDATA
@field_names = %i[
game_start_tick
game_state_flags
game_state_end_tick
]
2022-11-19 09:09:45 +00:00
super
2022-11-18 08:25:08 +00:00
end
def self.match_type?(type)
2022-11-18 08:25:08 +00:00
type == NETOBJTYPE_GAMEDATA
end
end
end