Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Cell

[17:7] extends: FxObj

Wraps a single cell inside a Grid. FXGL's Cell is abstract; this wrapper holds either a concrete AussomSimpleCell (Aussom's no-extra-data subclass) or any subclass returned from FXGL code (for example AStarCell from pathfinding). Cells carry an integer (x, y) position, optional user data, and a Manhattan-distance helper. The (x, y) and userData are the part Aussom users normally interact with.

Methods

  • Cell (int X = 0, int Y = 0)

    Creates a new AussomSimpleCell at the given grid coordinates.

    • @p X is the column.
    • @p Y is the row.
  • adopt (object Ajo)

    Wraps an existing Cell AussomJavaObject.

    • @p Ajo is an AussomJavaObject around an FXGL Cell.
    • @r A new Cell wrapper.
  • getX ()

    Returns the cell's X (column) coordinate.

    • @r An int.
  • getY ()

    Returns the cell's Y (row) coordinate.

    • @r An int.
  • getUserData ()

    Returns user data attached via setUserData, or null.

    • @r An AussomJavaObject or null.
  • setUserData (Data)

    Attaches user-specific data to this cell.

    • @p Data is any value (typically an Aussom object or AussomJavaObject).
    • @r this object
  • distance (object Other)

    Returns the Manhattan distance (no diagonal movement) from this cell to another.

    • @p Other is a Cell wrapper.
    • @r An int with the cell distance.