Class: D3MPQ::ModCode
- Inherits:
-
BinData::Record
- Object
- BinData::Record
- D3MPQ::ModCode
- Defined in:
- lib/d3_mpq/mod_code.rb
Defined Under Namespace
Classes: Stack
Instance Method Summary collapse
-
#base ⇒ Object
HACK Returns: Instance of BinData::Record that respond to :variable_content.
- #count ⇒ Object
- #data ⇒ Object
- #empty? ⇒ Boolean
-
#id ⇒ Object
Returns: nil if mod_code is 0xFFFFFFFF, mod_code otherwise.
- #index ⇒ Object
- #max ⇒ Object
- #min ⇒ Object
- #stack ⇒ Object
- #trace ⇒ Object
Instance Method Details
#base ⇒ Object
HACK Returns: Instance of BinData::Record that respond to :variable_content
21 22 23 |
# File 'lib/d3_mpq/mod_code.rb', line 21 def base parent.parent.parent.parent end |
#count ⇒ Object
29 30 31 |
# File 'lib/d3_mpq/mod_code.rb', line 29 def count mod_length / 4 end |
#data ⇒ Object
33 34 35 |
# File 'lib/d3_mpq/mod_code.rb', line 33 def data base.variable_content[index, count] end |
#empty? ⇒ Boolean
37 38 39 |
# File 'lib/d3_mpq/mod_code.rb', line 37 def empty? mod_length == 0 end |
#id ⇒ Object
Returns: nil if mod_code is 0xFFFFFFFF, mod_code otherwise
15 16 17 |
# File 'lib/d3_mpq/mod_code.rb', line 15 def id self.mod_code == 0xFFFFFFFF ? nil : self.mod_code.to_i end |
#index ⇒ Object
25 26 27 |
# File 'lib/d3_mpq/mod_code.rb', line 25 def index (mod_offset - base.data_num_bytes - base.data_offset) / 4 end |
#max ⇒ Object
45 46 47 |
# File 'lib/d3_mpq/mod_code.rb', line 45 def max stack.max || 0.0 end |
#min ⇒ Object
41 42 43 |
# File 'lib/d3_mpq/mod_code.rb', line 41 def min stack.min || 0.0 end |
#stack ⇒ Object
53 54 55 |
# File 'lib/d3_mpq/mod_code.rb', line 53 def stack @stack ||= Stack.new(data) end |
#trace ⇒ Object
49 50 51 |
# File 'lib/d3_mpq/mod_code.rb', line 49 def trace stack.trace end |