Module: GG::PACKET_NEW_STATUS

Defined in:
lib/GRuby/GG_packets.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#description=(value) ⇒ Object (writeonly)

opis, nie musi wystąpić */



166
167
168
# File 'lib/GRuby/GG_packets.rb', line 166

def description=(value)
  @description = value
end

#status=(value) ⇒ Object (writeonly)

na jaki zmienić? */



165
166
167
# File 'lib/GRuby/GG_packets.rb', line 165

def status=(value)
  @status = value
end

#time=(value) ⇒ Object (writeonly)

czas, nie musi wystąpić */



167
168
169
# File 'lib/GRuby/GG_packets.rb', line 167

def time=(value)
  @time = value
end

Instance Method Details

#lengthObject



183
184
185
# File 'lib/GRuby/GG_packets.rb', line 183

def length
  4+(@description ? @description.length : 1)+4
end

#packedObject



187
188
189
# File 'lib/GRuby/GG_packets.rb', line 187

def packed
  pack 'II IA*I'
end

#packetObject



173
174
175
176
177
178
179
180
181
# File 'lib/GRuby/GG_packets.rb', line 173

def packet
  [
    type,
    length,
    @status      ? @status           : 0,
    @description ? "#{@description}" : "\0",
    @time        ? @time             : 0
  ]
end

#typeObject



169
170
171
# File 'lib/GRuby/GG_packets.rb', line 169

def type
  NEW_STATUS
end