TileMap class

A map which contains integer values which can be turned into Tile instances.

Annotations
  • @JsonSerializable()

Constructors

TileMap({required int width, required int height, int defaultFlags = 0, Map<int, Map<int, int>> tiles = const {}})
Create an instance.
const
TileMap.fromJson(Map<String, dynamic> json)
Create an instance from a JSON object.
factory

Properties

defaultFlags int
The default flags for newly-created tiles.
final
hashCode int
The hash code for this object.
no setterinherited
height int
The height of this map.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tiles Map<int, Map<int, int>>
The created tiles.
final
width int
The width of the map.
final

Methods

clearTileFlag({required Point<int> point, required int flag}) → void
Clear the given flag from the tile at the given point.
getTileFlags(Point<int> point) int
Get the value for the given coordinates.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setTileFlag({required Point<int> point, required int flag}) → void
Set the given flag on the tile at the given point.
setTileFlags({required Point<int> point, required int flags}) → void
Set the tile at the given point to the given flags.
toJson() Map<String, dynamic>
Convert an instance to JSON.
toString() String
A string representation of this object.
inherited
validCoordinates(Point<int> point) bool
Returns true if the given point represents valid coordinates for this map.

Operators

operator ==(Object other) bool
The equality operator.
inherited