Class: Overlook::Csgo::Demo::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/overlook/csgo/demo/command.rb

Defined Under Namespace

Modules: TYPE

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#slotObject

Returns the value of attribute slot.



21
22
23
# File 'lib/overlook/csgo/demo/command.rb', line 21

def slot
  @slot
end

#tickObject

Returns the value of attribute tick.



21
22
23
# File 'lib/overlook/csgo/demo/command.rb', line 21

def tick
  @tick
end

#typeObject

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

Returns:

  • (Boolean)


65
66
67
# File 'lib/overlook/csgo/demo/command.rb', line 65

def packet?
  type == :packet
end

#skipable?Boolean

Returns:

  • (Boolean)


69
70
71
# File 'lib/overlook/csgo/demo/command.rb', line 69

def skipable?
  type == :skipable
end

#stop?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/overlook/csgo/demo/command.rb', line 57

def stop?
  type == :stop
end

#sync?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/overlook/csgo/demo/command.rb', line 61

def sync?
  type == :sync
end

#unknown?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/overlook/csgo/demo/command.rb', line 53

def unknown?
  type == :unknown
end