Class: NetObj::PlayerInput
- Inherits:
-
SnapItemBase
- Object
- SnapItemBase
- NetObj::PlayerInput
- Defined in:
- lib/snapshot/items/player_input.rb
Instance Attribute Summary collapse
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#fire ⇒ Object
Returns the value of attribute fire.
-
#hook ⇒ Object
Returns the value of attribute hook.
-
#jump ⇒ Object
Returns the value of attribute jump.
-
#next_weapon ⇒ Object
Returns the value of attribute next_weapon.
-
#player_flags ⇒ Object
Returns the value of attribute player_flags.
-
#prev_weapon ⇒ Object
Returns the value of attribute prev_weapon.
-
#target_x ⇒ Object
Returns the value of attribute target_x.
-
#target_y ⇒ Object
Returns the value of attribute target_y.
-
#wanted_weapon ⇒ Object
Returns the value of attribute wanted_weapon.
Attributes inherited from SnapItemBase
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash_or_raw) ⇒ PlayerInput
constructor
A new instance of PlayerInput.
Methods inherited from SnapItemBase
#init_hash, #init_raw, #init_unpacker, #to_a, #to_h, #to_s, #validate
Constructor Details
#initialize(hash_or_raw) ⇒ PlayerInput
Returns a new instance of PlayerInput.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/snapshot/items/player_input.rb', line 12 def initialize(hash_or_raw) @field_names = %i[ direction target_x target_y jump fire hook player_flags wanted_weapon next_weapon prev_weapon ] super end |
Instance Attribute Details
#direction ⇒ Object
Returns the value of attribute direction.
7 8 9 |
# File 'lib/snapshot/items/player_input.rb', line 7 def direction @direction end |
#fire ⇒ Object
Returns the value of attribute fire.
7 8 9 |
# File 'lib/snapshot/items/player_input.rb', line 7 def fire @fire end |
#hook ⇒ Object
Returns the value of attribute hook.
7 8 9 |
# File 'lib/snapshot/items/player_input.rb', line 7 def hook @hook end |
#jump ⇒ Object
Returns the value of attribute jump.
7 8 9 |
# File 'lib/snapshot/items/player_input.rb', line 7 def jump @jump end |
#next_weapon ⇒ Object
Returns the value of attribute next_weapon.
7 8 9 |
# File 'lib/snapshot/items/player_input.rb', line 7 def next_weapon @next_weapon end |
#player_flags ⇒ Object
Returns the value of attribute player_flags.
7 8 9 |
# File 'lib/snapshot/items/player_input.rb', line 7 def player_flags @player_flags end |
#prev_weapon ⇒ Object
Returns the value of attribute prev_weapon.
7 8 9 |
# File 'lib/snapshot/items/player_input.rb', line 7 def prev_weapon @prev_weapon end |
#target_x ⇒ Object
Returns the value of attribute target_x.
7 8 9 |
# File 'lib/snapshot/items/player_input.rb', line 7 def target_x @target_x end |
#target_y ⇒ Object
Returns the value of attribute target_y.
7 8 9 |
# File 'lib/snapshot/items/player_input.rb', line 7 def target_y @target_y end |
#wanted_weapon ⇒ Object
Returns the value of attribute wanted_weapon.
7 8 9 |
# File 'lib/snapshot/items/player_input.rb', line 7 def wanted_weapon @wanted_weapon end |
Class Method Details
.match_type?(type) ⇒ Boolean
28 29 30 |
# File 'lib/snapshot/items/player_input.rb', line 28 def self.match_type?(type) type == NETOBJTYPE_PLAYERINPUT end |