Class: NetObj::Character
- Inherits:
-
SnapItemBase
- Object
- SnapItemBase
- NetObj::Character
- Defined in:
- lib/snapshot/items/character.rb
Instance Attribute Summary collapse
-
#ammo_count ⇒ Object
Returns the value of attribute ammo_count.
-
#angle ⇒ Object
Returns the value of attribute angle.
-
#armor ⇒ Object
Returns the value of attribute armor.
-
#attack_tick ⇒ Object
Returns the value of attribute attack_tick.
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#emote ⇒ Object
Returns the value of attribute emote.
-
#health ⇒ Object
Returns the value of attribute health.
-
#hook_dx ⇒ Object
Returns the value of attribute hook_dx.
-
#hook_dy ⇒ Object
Returns the value of attribute hook_dy.
-
#hook_state ⇒ Object
Returns the value of attribute hook_state.
-
#hook_tick ⇒ Object
Returns the value of attribute hook_tick.
-
#hook_x ⇒ Object
Returns the value of attribute hook_x.
-
#hook_y ⇒ Object
Returns the value of attribute hook_y.
-
#hooked_player ⇒ Object
Returns the value of attribute hooked_player.
-
#jumped ⇒ Object
Returns the value of attribute jumped.
-
#tick ⇒ Object
Returns the value of attribute tick.
-
#triggered_events ⇒ Object
Returns the value of attribute triggered_events.
-
#vel_x ⇒ Object
Returns the value of attribute vel_x.
-
#vel_y ⇒ Object
Returns the value of attribute vel_y.
-
#weapon ⇒ Object
Returns the value of attribute weapon.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Attributes inherited from SnapItemBase
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash_or_raw) ⇒ Character
constructor
A new instance of Character.
Methods inherited from SnapItemBase
#init_hash, #init_raw, #init_unpacker, #to_a, #to_h, #to_s, #validate
Constructor Details
#initialize(hash_or_raw) ⇒ Character
Returns a new instance of Character.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/snapshot/items/character.rb', line 11 def initialize(hash_or_raw) @field_names = i[ tick x y vel_x vel_y angle direction jumped hooked_player hook_state hook_tick hook_x hook_y hook_dx hook_dy health armor ammo_count weapon emote attack_tick triggered_events ] super end |
Instance Attribute Details
#ammo_count ⇒ Object
Returns the value of attribute ammo_count.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def ammo_count @ammo_count end |
#angle ⇒ Object
Returns the value of attribute angle.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def angle @angle end |
#armor ⇒ Object
Returns the value of attribute armor.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def armor @armor end |
#attack_tick ⇒ Object
Returns the value of attribute attack_tick.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def attack_tick @attack_tick end |
#direction ⇒ Object
Returns the value of attribute direction.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def direction @direction end |
#emote ⇒ Object
Returns the value of attribute emote.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def emote @emote end |
#health ⇒ Object
Returns the value of attribute health.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def health @health end |
#hook_dx ⇒ Object
Returns the value of attribute hook_dx.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def hook_dx @hook_dx end |
#hook_dy ⇒ Object
Returns the value of attribute hook_dy.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def hook_dy @hook_dy end |
#hook_state ⇒ Object
Returns the value of attribute hook_state.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def hook_state @hook_state end |
#hook_tick ⇒ Object
Returns the value of attribute hook_tick.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def hook_tick @hook_tick end |
#hook_x ⇒ Object
Returns the value of attribute hook_x.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def hook_x @hook_x end |
#hook_y ⇒ Object
Returns the value of attribute hook_y.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def hook_y @hook_y end |
#hooked_player ⇒ Object
Returns the value of attribute hooked_player.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def hooked_player @hooked_player end |
#jumped ⇒ Object
Returns the value of attribute jumped.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def jumped @jumped end |
#tick ⇒ Object
Returns the value of attribute tick.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def tick @tick end |
#triggered_events ⇒ Object
Returns the value of attribute triggered_events.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def triggered_events @triggered_events end |
#vel_x ⇒ Object
Returns the value of attribute vel_x.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def vel_x @vel_x end |
#vel_y ⇒ Object
Returns the value of attribute vel_y.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def vel_y @vel_y end |
#weapon ⇒ Object
Returns the value of attribute weapon.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def weapon @weapon end |
#x ⇒ Object
Returns the value of attribute x.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
7 8 9 |
# File 'lib/snapshot/items/character.rb', line 7 def y @y end |
Class Method Details
.match_type?(type) ⇒ Boolean
39 40 41 |
# File 'lib/snapshot/items/character.rb', line 39 def self.match_type?(type) type == NETOBJTYPE_CHARACTER end |