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.
219 220 221 |
# File 'lib/wolfrpg/database.rb', line 219 def initialize(coder) @name = coder.read_string end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
215 216 217 |
# File 'lib/wolfrpg/database.rb', line 215 def args @args end |
#default_value ⇒ Object
Returns the value of attribute default_value.
216 217 218 |
# File 'lib/wolfrpg/database.rb', line 216 def default_value @default_value end |
#indexinfo ⇒ Object
Returns the value of attribute indexinfo.
217 218 219 |
# File 'lib/wolfrpg/database.rb', line 217 def indexinfo @indexinfo end |
#name ⇒ Object
Returns the value of attribute name.
211 212 213 |
# File 'lib/wolfrpg/database.rb', line 211 def name @name end |
#string_args ⇒ Object
Returns the value of attribute string_args.
214 215 216 |
# File 'lib/wolfrpg/database.rb', line 214 def string_args @string_args end |
#type ⇒ Object
Returns the value of attribute type.
212 213 214 |
# File 'lib/wolfrpg/database.rb', line 212 def type @type end |
#unknown1 ⇒ Object
Returns the value of attribute unknown1.
213 214 215 |
# File 'lib/wolfrpg/database.rb', line 213 def unknown1 @unknown1 end |
Instance Method Details
#dump_dat(coder) ⇒ Object
231 232 233 |
# File 'lib/wolfrpg/database.rb', line 231 def dump_dat(coder) coder.write_int(@indexinfo) end |
#dump_project(coder) ⇒ Object
223 224 225 |
# File 'lib/wolfrpg/database.rb', line 223 def dump_project(coder) coder.write_string(@name) end |
#index ⇒ Object
243 244 245 246 247 248 249 |
# File 'lib/wolfrpg/database.rb', line 243 def index if string? @indexinfo - STRING_START else @indexinfo - INT_START end end |
#int? ⇒ Boolean
239 240 241 |
# File 'lib/wolfrpg/database.rb', line 239 def int? !string? end |
#read_dat(coder) ⇒ Object
227 228 229 |
# File 'lib/wolfrpg/database.rb', line 227 def read_dat(coder) @indexinfo = coder.read_int end |
#string? ⇒ Boolean
235 236 237 |
# File 'lib/wolfrpg/database.rb', line 235 def string? @indexinfo >= STRING_START end |