Class: GBTiles::GBM::Map::Objects::MapTileDataRecord
- Inherits:
-
Object
- Object
- GBTiles::GBM::Map::Objects::MapTileDataRecord
- Defined in:
- lib/gbtiles/gbm/map/objects/map_tile_data_record.rb
Instance Attribute Summary collapse
-
#flipped_horizontally ⇒ Object
Returns the value of attribute flipped_horizontally.
-
#flipped_vertically ⇒ Object
Returns the value of attribute flipped_vertically.
-
#gbc_palette ⇒ Object
Returns the value of attribute gbc_palette.
-
#sgb_palette ⇒ Object
Returns the value of attribute sgb_palette.
-
#tile_number ⇒ Object
Returns the value of attribute tile_number.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ MapTileDataRecord
constructor
A new instance of MapTileDataRecord.
Constructor Details
#initialize ⇒ MapTileDataRecord
Returns a new instance of MapTileDataRecord.
13 14 |
# File 'lib/gbtiles/gbm/map/objects/map_tile_data_record.rb', line 13 def initialize end |
Instance Attribute Details
#flipped_horizontally ⇒ Object
Returns the value of attribute flipped_horizontally.
10 11 12 |
# File 'lib/gbtiles/gbm/map/objects/map_tile_data_record.rb', line 10 def flipped_horizontally @flipped_horizontally end |
#flipped_vertically ⇒ Object
Returns the value of attribute flipped_vertically.
11 12 13 |
# File 'lib/gbtiles/gbm/map/objects/map_tile_data_record.rb', line 11 def flipped_vertically @flipped_vertically end |
#gbc_palette ⇒ Object
Returns the value of attribute gbc_palette.
8 9 10 |
# File 'lib/gbtiles/gbm/map/objects/map_tile_data_record.rb', line 8 def gbc_palette @gbc_palette end |
#sgb_palette ⇒ Object
Returns the value of attribute sgb_palette.
9 10 11 |
# File 'lib/gbtiles/gbm/map/objects/map_tile_data_record.rb', line 9 def sgb_palette @sgb_palette end |
#tile_number ⇒ Object
Returns the value of attribute tile_number.
7 8 9 |
# File 'lib/gbtiles/gbm/map/objects/map_tile_data_record.rb', line 7 def tile_number @tile_number end |
Class Method Details
.initFromBitString(number) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/gbtiles/gbm/map/objects/map_tile_data_record.rb', line 16 def self.initFromBitString number record = GBTiles::GBM::Map::Objects::MapTileDataRecord.new record.tile_number = number.bits(0..9) record.gbc_palette = number.bits(10..14) record.sgb_palette = number.bits(16..18) record.flipped_horizontally = number.bits(22..22) record.flipped_vertically = number.bits(23..23) record end |