SimpleGridCell
A simple implementation of a Cell that is used in a grid-based map.
Parameters
the location of this cell
the map this cell is located on
Functions
Whether this cell can be accessed from the given location. This is used to determine whether a path can be constructed from the given location to this cell. If this cell or the other cell is not accessible, this method returns false. Depending on the underlying implementation, if the other cell is more than one cell away from this cell, this method should return false as it only checks for direct accessibility.
Retrieves an attribute with the given key. If no attribute with the given key exists, an exception is thrown.
Retrieves an attribute with the given key. If no attribute with the given key exists, the default value is returned.
Retrieves an attribute with the given key. If no attribute with the given key exists, null is returned.
Returns a map of all attributes that are associated with a key which can be modified.
Retrieves an attribute with the given key and casts it to the given type. If the attribute is not of the given type, a ClassCastException is thrown. If no attribute with the given key exists, an exception is thrown.
Retrieves an attribute with the given key and casts it to the given type. If the attribute is not of the given type, a ClassCastException is thrown. If no attribute with the given key exists, the default value is returned.
Retrieves an attribute with the given key and casts it to the given type. If the attribute is not of the given type, a ClassCastException is thrown. If no attribute with the given key exists, null is returned.
Computes all neighboring cells. That are cells for which only one dimension differs by exactly 1. Excluded are diagonal cells that will be included in the returned list if includeDiagonals is true. If this cell is located on the edge of the map, the returned list will not contain cells that are outside of the map (for example if this cell has the location 0, 0, 0, the returned list will not contain the cell at 0, 0, -1).
Whether this cell has an attribute with the given key.
Removes an attribute with the given key. If no attribute with the given key exists, null is returned; otherwise the previous value that was associated with the key is returned.
Sets an attribute with the given key to the given value. If an attribute with the same key already exists, it will be overwritten.