Class: GBTiles::GBR::TileSet::Objects::Palettes
- Inherits:
-
GBTiles::GBR::TileSet::Object
- Object
- GBTiles::GBR::TileSet::Object
- GBTiles::GBR::TileSet::Objects::Palettes
- Defined in:
- lib/gbtiles/gbr/tile_set/objects/palettes.rb
Instance Attribute Summary collapse
-
#colors ⇒ Object
Returns the value of attribute colors.
-
#count ⇒ Object
Returns the value of attribute count.
-
#id ⇒ Object
Returns the value of attribute id.
-
#sgb_colors ⇒ Object
Returns the value of attribute sgb_colors.
-
#sgb_count ⇒ Object
Returns the value of attribute sgb_count.
Attributes inherited from GBTiles::GBR::TileSet::Object
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Palettes
constructor
A new instance of Palettes.
Constructor Details
#initialize ⇒ Palettes
Returns a new instance of Palettes.
13 14 15 |
# File 'lib/gbtiles/gbr/tile_set/objects/palettes.rb', line 13 def initialize super GBTiles::GBR::TileSet::OBJECT_TYPE[:palettes] end |
Instance Attribute Details
#colors ⇒ Object
Returns the value of attribute colors.
9 10 11 |
# File 'lib/gbtiles/gbr/tile_set/objects/palettes.rb', line 9 def colors @colors end |
#count ⇒ Object
Returns the value of attribute count.
8 9 10 |
# File 'lib/gbtiles/gbr/tile_set/objects/palettes.rb', line 8 def count @count end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/gbtiles/gbr/tile_set/objects/palettes.rb', line 7 def id @id end |
#sgb_colors ⇒ Object
Returns the value of attribute sgb_colors.
11 12 13 |
# File 'lib/gbtiles/gbr/tile_set/objects/palettes.rb', line 11 def sgb_colors @sgb_colors end |
#sgb_count ⇒ Object
Returns the value of attribute sgb_count.
10 11 12 |
# File 'lib/gbtiles/gbr/tile_set/objects/palettes.rb', line 10 def sgb_count @sgb_count end |
Class Method Details
.initFromBitString(src) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/gbtiles/gbr/tile_set/objects/palettes.rb', line 17 def self.initFromBitString src object = GBTiles::GBR::TileSet::Objects::Palettes.new object.id = GBTiles::DataType.word!(src) object.count = GBTiles::DataType.word!(src) object.colors = src.slice!(0, object.count) object.sgb_count = GBTiles::DataType.word!(src) object.sgb_colors = src.slice!(0, object.sgb_count) object end |