C
- Collision type used.T
- Tile type used.public abstract class MapTilePlatform<C extends Enum<C> & CollisionTile,T extends TilePlatform<C>> extends MapTileGame<C,T>
BLOC_SIZE, heightInTile, minimap, patternsDirectory, tileHeight, tileWidth, widthInTile
Constructor and Description |
---|
MapTilePlatform(int tileWidth,
int tileHeight)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
assignCollisionFunction(C collision,
CollisionFunction function)
Assign the collision function to all tiles with the same collision.
|
void |
createCollisionDraw(Class<C> collisionClass)
Create the collision draw surface.
|
T |
getFirstTileHit(Localizable localizable,
EnumSet<C> collisions,
boolean applyRayCast)
Get the first tile hit by the localizable that contains collision, applying a ray tracing from its old location
to its current.
|
int |
getInTileX(Localizable localizable)
Get location x relative to map referential as tile.
|
int |
getInTileY(Localizable localizable)
Get location y relative to map referential as tile.
|
T |
getTile(EntityPlatform entity,
int offsetX,
int offsetY)
Get the tile at the entity location.
|
void |
loadCollisions(com.b3dgs.lionengine.core.Media media) |
void |
removeCollisionFunction(Class<C> collisionClass,
CollisionFunction function)
Remove a collision function.
|
protected void |
renderTile(com.b3dgs.lionengine.Graphic g,
T tile,
int x,
int y) |
append, clear, create, createMiniMap, createTile, getCollision, getCollisionFrom, getHeightInTile, getMiniMap, getNumberPatterns, getNumberTiles, getPattern, getPatterns, getPatternsDirectory, getTile, getTileHeight, getTilePixelColor, getTileWidth, getWidthInTile, isCreated, load, loadPatterns, loadTile, render, render, renderingTile, renderMiniMap, save, saveTile, setTile
public MapTilePlatform(int tileWidth, int tileHeight)
tileWidth
- The tile width.tileHeight
- The tile height.public void createCollisionDraw(Class<C> collisionClass)
collisionClass
- The collisionClass enumeration class.public void assignCollisionFunction(C collision, CollisionFunction function)
collision
- The current collision enum.function
- The function reference.public void removeCollisionFunction(Class<C> collisionClass, CollisionFunction function)
collisionClass
- The collision enum type.function
- The function to remove.public T getTile(EntityPlatform entity, int offsetX, int offsetY)
entity
- The entity.offsetX
- The horizontal offset search.offsetY
- The vertical offset search.public T getFirstTileHit(Localizable localizable, EnumSet<C> collisions, boolean applyRayCast)
localizable
- The localizable reference.collisions
- Collisions list to search for.applyRayCast
- true
to apply collision to each tile crossed, false
to ignore and
just return the first tile hit.null
if none found.public int getInTileX(Localizable localizable)
localizable
- The localizable reference.public int getInTileY(Localizable localizable)
localizable
- The localizable reference.public void loadCollisions(com.b3dgs.lionengine.core.Media media)
loadCollisions
in class MapTileGame<C extends Enum<C> & CollisionTile,T extends TilePlatform<C>>
protected void renderTile(com.b3dgs.lionengine.Graphic g, T tile, int x, int y)
renderTile
in class MapTileGame<C extends Enum<C> & CollisionTile,T extends TilePlatform<C>>
Copyright © 2014 Byron 3D Games Studio. All rights reserved.