2022-11-19 10:24:13 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require_relative '../snap_item_base'
|
|
|
|
|
|
|
|
class NetObj
|
|
|
|
class PlayerInput < SnapItemBase
|
|
|
|
attr_accessor :direction, :target_x, :target_y,
|
|
|
|
:jump, :fire, :hook,
|
|
|
|
:player_flags, :wanted_weapon,
|
|
|
|
:next_weapon, :prev_weapon
|
|
|
|
|
|
|
|
def initialize(hash_or_raw)
|
2024-02-21 06:44:49 +00:00
|
|
|
@type = NETOBJTYPE_PLAYERINPUT
|
2022-11-19 10:24:13 +00:00
|
|
|
@field_names = %i[
|
|
|
|
direction
|
|
|
|
target_x
|
|
|
|
target_y
|
|
|
|
jump
|
|
|
|
fire
|
|
|
|
hook
|
|
|
|
player_flags
|
|
|
|
wanted_weapon
|
|
|
|
next_weapon
|
|
|
|
prev_weapon
|
|
|
|
]
|
|
|
|
super
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.match_type?(type)
|
|
|
|
type == NETOBJTYPE_PLAYERINPUT
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|