Class: Overlook::Csgo::Demo::Command
- Inherits:
-
Object
- Object
- Overlook::Csgo::Demo::Command
- Defined in:
- lib/overlook/csgo/demo/command.rb
Defined Under Namespace
Modules: TYPE
Instance Attribute Summary collapse
-
#slot ⇒ Object
Returns the value of attribute slot.
-
#tick ⇒ Object
Returns the value of attribute tick.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type, tick, slot) ⇒ Command
constructor
A new instance of Command.
- #packet? ⇒ Boolean
- #skipable? ⇒ Boolean
- #stop? ⇒ Boolean
- #sync? ⇒ Boolean
- #unknown? ⇒ Boolean
Constructor Details
#initialize(type, tick, slot) ⇒ Command
Returns a new instance of Command.
23 24 25 26 27 28 |
# File 'lib/overlook/csgo/demo/command.rb', line 23 def initialize(type, tick, slot) @type = type @tick = tick @slot = slot @tick = 0 unless packet? end |
Instance Attribute Details
#slot ⇒ Object
Returns the value of attribute slot.
21 22 23 |
# File 'lib/overlook/csgo/demo/command.rb', line 21 def slot @slot end |
#tick ⇒ Object
Returns the value of attribute tick.
21 22 23 |
# File 'lib/overlook/csgo/demo/command.rb', line 21 def tick @tick end |
#type ⇒ Object
Returns the value of attribute type.
21 22 23 |
# File 'lib/overlook/csgo/demo/command.rb', line 21 def type @type end |
Class Method Details
.from_io(reader) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/overlook/csgo/demo/command.rb', line 30 def self.from_io(reader) cmd = reader.byte tick = reader.signed_int32 slot = reader.byte new(cmd, tick, slot) end |
Instance Method Details
#packet? ⇒ Boolean
65 66 67 |
# File 'lib/overlook/csgo/demo/command.rb', line 65 def packet? type == :packet end |
#skipable? ⇒ Boolean
69 70 71 |
# File 'lib/overlook/csgo/demo/command.rb', line 69 def skipable? type == :skipable end |
#stop? ⇒ Boolean
57 58 59 |
# File 'lib/overlook/csgo/demo/command.rb', line 57 def stop? type == :stop end |
#sync? ⇒ Boolean
61 62 63 |
# File 'lib/overlook/csgo/demo/command.rb', line 61 def sync? type == :sync end |
#unknown? ⇒ Boolean
53 54 55 |
# File 'lib/overlook/csgo/demo/command.rb', line 53 def unknown? type == :unknown end |