Class: WWMD::VSStubs::VSUnit

Inherits:
Object
  • Object
show all
Includes:
WWMD::VSStubHelpers
Defined in:
lib/wwmd/viewstate/vs_stubs/vs_unit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WWMD::VSStubHelpers

#opcode, #size, #to_sym

Methods included from WWMD::ViewStateUtils

#deserialize_type, #dlog, #magic?, #next_type, #offset, #putd, #read, #read_7bit_encoded_int, #read_double, #read_int, #read_int32, #read_raw_byte, #read_short, #read_string, #serialize_type, #slog, #throw, #write_7bit_encoded_int, #write_double, #write_int, #write_int32, #write_short

Constructor Details

#initialize(dword, word) ⇒ VSUnit

Returns a new instance of VSUnit.



9
10
11
12
13
# File 'lib/wwmd/viewstate/vs_stubs/vs_unit.rb', line 9

def initialize(dword,word)
  @dword = dword
  @word = word
  @value = ''
end

Instance Attribute Details

#dwordObject (readonly)

Returns the value of attribute dword.



5
6
7
# File 'lib/wwmd/viewstate/vs_stubs/vs_unit.rb', line 5

def dword
  @dword
end

#valueObject (readonly)

Returns the value of attribute value.



7
8
9
# File 'lib/wwmd/viewstate/vs_stubs/vs_unit.rb', line 7

def value
  @value
end

#wordObject (readonly)

Returns the value of attribute word.



6
7
8
# File 'lib/wwmd/viewstate/vs_stubs/vs_unit.rb', line 6

def word
  @word
end

Instance Method Details

#serializeObject



15
16
17
18
19
20
# File 'lib/wwmd/viewstate/vs_stubs/vs_unit.rb', line 15

def serialize
  stack = super
  stack << write_double(self.dword)
  stack << write_single(self.word)
  return stack
end

#to_xmlObject



22
23
24
25
26
27
# File 'lib/wwmd/viewstate/vs_stubs/vs_unit.rb', line 22

def to_xml
  xml = super
  xml.add_attribute("dword",self.dword.to_s)
  xml.add_attribute("word",self.word.to_s)
  xml
end