Class: GBTiles::GBM::Map::Objects::Map

Inherits:
GBTiles::GBM::Map::Object show all
Defined in:
lib/gbtiles/gbm/map/objects/map.rb

Instance Attribute Summary collapse

Attributes inherited from GBTiles::GBM::Map::Object

#master_id, #object_id, #object_type

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMap

Returns a new instance of Map.



15
16
17
# File 'lib/gbtiles/gbm/map/objects/map.rb', line 15

def initialize
  super GBTiles::GBM::Map::OBJECT_TYPE[:map]
end

Instance Attribute Details

#heightObject

Returns the value of attribute height.



9
10
11
# File 'lib/gbtiles/gbm/map/objects/map.rb', line 9

def height
  @height
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/gbtiles/gbm/map/objects/map.rb', line 7

def name
  @name
end

#prop_color_countObject

Returns the value of attribute prop_color_count.



13
14
15
# File 'lib/gbtiles/gbm/map/objects/map.rb', line 13

def prop_color_count
  @prop_color_count
end

#prop_countObject

Returns the value of attribute prop_count.



10
11
12
# File 'lib/gbtiles/gbm/map/objects/map.rb', line 10

def prop_count
  @prop_count
end

#tile_countObject

Returns the value of attribute tile_count.



12
13
14
# File 'lib/gbtiles/gbm/map/objects/map.rb', line 12

def tile_count
  @tile_count
end

#tile_fileObject

Returns the value of attribute tile_file.



11
12
13
# File 'lib/gbtiles/gbm/map/objects/map.rb', line 11

def tile_file
  @tile_file
end

#widthObject

Returns the value of attribute width.



8
9
10
# File 'lib/gbtiles/gbm/map/objects/map.rb', line 8

def width
  @width
end

Class Method Details

.initFromBitString(src) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/gbtiles/gbm/map/objects/map.rb', line 19

def self.initFromBitString src
  object = GBTiles::GBM::Map::Objects::Map.new

  object.name               = GBTiles::DataType.string!(src, 128)
  object.width              = GBTiles::DataType.long!(src)
  object.height             = GBTiles::DataType.long!(src)
  object.prop_count         = GBTiles::DataType.long!(src)
  object.tile_file          = GBTiles::DataType.string!(src, 256)
  object.tile_count         = GBTiles::DataType.long!(src)
  object.prop_color_count   = GBTiles::DataType.long!(src)

  object
end