Class: NetObj::Projectile
- Inherits:
-
SnapItemBase
- Object
- SnapItemBase
- NetObj::Projectile
- Defined in:
- lib/snapshot/items/projectile.rb
Instance Attribute Summary collapse
-
#start_tick ⇒ Object
Returns the value of attribute start_tick.
-
#type ⇒ Object
Returns the value of attribute type.
-
#vel_x ⇒ Object
Returns the value of attribute vel_x.
-
#vel_y ⇒ Object
Returns the value of attribute vel_y.
-
#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) ⇒ Projectile
constructor
A new instance of Projectile.
Methods inherited from SnapItemBase
#init_hash, #init_raw, #init_unpacker, #to_a, #to_h, #to_s, #validate
Constructor Details
#initialize(hash_or_raw) ⇒ Projectile
Returns a new instance of Projectile.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/snapshot/items/projectile.rb', line 9 def initialize(hash_or_raw) @field_names = %i[ x y vel_x vel_y type start_tick ] super end |
Instance Attribute Details
#start_tick ⇒ Object
Returns the value of attribute start_tick.
7 8 9 |
# File 'lib/snapshot/items/projectile.rb', line 7 def start_tick @start_tick end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/snapshot/items/projectile.rb', line 7 def type @type end |
#vel_x ⇒ Object
Returns the value of attribute vel_x.
7 8 9 |
# File 'lib/snapshot/items/projectile.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/projectile.rb', line 7 def vel_y @vel_y end |
#x ⇒ Object
Returns the value of attribute x.
7 8 9 |
# File 'lib/snapshot/items/projectile.rb', line 7 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
7 8 9 |
# File 'lib/snapshot/items/projectile.rb', line 7 def y @y end |
Class Method Details
.match_type?(type) ⇒ Boolean
21 22 23 |
# File 'lib/snapshot/items/projectile.rb', line 21 def self.match_type?(type) type == NETOBJTYPE_PROJECTILE end |