Class UncrossableCell

java.lang.Object
fr.r1r0r0.deltaengine.model.elements.cells.Cell
fr.r1r0r0.deltaengine.model.elements.cells.UncrossableCell
All Implemented Interfaces:
Element<java.lang.Integer>
Direct Known Subclasses:
OutOfBoundCell, Wall

public class UncrossableCell
extends Cell
A default uncrossable cell. Any entity cannot cross this cell. Useful when you want to create a cell who nobody can cross it. Like walls.
  • Constructor Summary

    Constructors
    Constructor Description
    UncrossableCell​(int x, int y, Sprite sprite)
    Default constructor.
  • Method Summary

    Modifier and Type Method Description
    boolean isCrossableBy​(Entity entity)
    Checks if given entity can cross this cell.

    Methods inherited from class fr.r1r0r0.deltaengine.model.elements.cells.Cell

    getCoordinates, getDimension, getName, getSprite, setCoordinates, setDimension, setSprite

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UncrossableCell

      public UncrossableCell​(int x, int y, Sprite sprite)
      Default constructor. Set a case sprite and coordinates in the map.
      Parameters:
      x - the abscissa coordinate of the cell in the map. Coordinates values are integers.
      y - the ordinate coordinate of the cell in the map. Coordinates values are integers.
      sprite - the sprite to apply on the case
  • Method Details

    • isCrossableBy

      public final boolean isCrossableBy​(Entity entity)
      Description copied from class: Cell
      Checks if given entity can cross this cell. If entity cannot cross cell, then it will be blocked.
      Specified by:
      isCrossableBy in class Cell
      Parameters:
      entity - entity to check if he can cross
      Returns:
      boolean true if given entity can cross the cell, false otherwise.