Class: WolfRpg::Database::Field
- Inherits:
-
Object
- Object
- WolfRpg::Database::Field
- Defined in:
- lib/wolfrpg/database.rb
Constant Summary collapse
- STRING_START =
0x07D0- INT_START =
0x03E8
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#default_value ⇒ Object
Returns the value of attribute default_value.
-
#indexinfo ⇒ Object
Returns the value of attribute indexinfo.
-
#name ⇒ Object
Returns the value of attribute name.
-
#string_args ⇒ Object
Returns the value of attribute string_args.
-
#type ⇒ Object
Returns the value of attribute type.
-
#unknown1 ⇒ Object
Returns the value of attribute unknown1.
Instance Method Summary collapse
- #dump_dat(coder) ⇒ Object
- #dump_project(coder) ⇒ Object
- #index ⇒ Object
-
#initialize(coder) ⇒ Field
constructor
A new instance of Field.
- #int? ⇒ Boolean
- #read_dat(coder) ⇒ Object
- #string? ⇒ Boolean
Constructor Details
#initialize(coder) ⇒ Field
Returns a new instance of Field.
209 210 211 |
# File 'lib/wolfrpg/database.rb', line 209 def initialize(coder) @name = coder.read_string end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
205 206 207 |
# File 'lib/wolfrpg/database.rb', line 205 def args @args end |
#default_value ⇒ Object
Returns the value of attribute default_value.
206 207 208 |
# File 'lib/wolfrpg/database.rb', line 206 def default_value @default_value end |
#indexinfo ⇒ Object
Returns the value of attribute indexinfo.
207 208 209 |
# File 'lib/wolfrpg/database.rb', line 207 def indexinfo @indexinfo end |
#name ⇒ Object
Returns the value of attribute name.
201 202 203 |
# File 'lib/wolfrpg/database.rb', line 201 def name @name end |
#string_args ⇒ Object
Returns the value of attribute string_args.
204 205 206 |
# File 'lib/wolfrpg/database.rb', line 204 def string_args @string_args end |
#type ⇒ Object
Returns the value of attribute type.
202 203 204 |
# File 'lib/wolfrpg/database.rb', line 202 def type @type end |
#unknown1 ⇒ Object
Returns the value of attribute unknown1.
203 204 205 |
# File 'lib/wolfrpg/database.rb', line 203 def unknown1 @unknown1 end |
Instance Method Details
#dump_dat(coder) ⇒ Object
221 222 223 |
# File 'lib/wolfrpg/database.rb', line 221 def dump_dat(coder) coder.write_int(@indexinfo) end |
#dump_project(coder) ⇒ Object
213 214 215 |
# File 'lib/wolfrpg/database.rb', line 213 def dump_project(coder) coder.write_string(@name) end |
#index ⇒ Object
233 234 235 236 237 238 239 |
# File 'lib/wolfrpg/database.rb', line 233 def index if string? @indexinfo - STRING_START else @indexinfo - INT_START end end |
#int? ⇒ Boolean
229 230 231 |
# File 'lib/wolfrpg/database.rb', line 229 def int? !string? end |
#read_dat(coder) ⇒ Object
217 218 219 |
# File 'lib/wolfrpg/database.rb', line 217 def read_dat(coder) @indexinfo = coder.read_int end |
#string? ⇒ Boolean
225 226 227 |
# File 'lib/wolfrpg/database.rb', line 225 def string? @indexinfo >= STRING_START end |