Class GridComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.areas.terrain.GridComponent

public class GridComponent extends Component
  • Constructor Details

  • Method Details

    • tileToWorldPosition

      public com.badlogic.gdx.math.Vector2 tileToWorldPosition(com.badlogic.gdx.math.GridPoint2 tilePos)
      Convert tile coordinates to world position
    • tileToWorldPosition

      public com.badlogic.gdx.math.Vector2 tileToWorldPosition(int x, int y)
      Convert tile coordinates to world position
    • worldToTilePosition

      public com.badlogic.gdx.math.GridPoint2 worldToTilePosition(com.badlogic.gdx.math.Vector2 worldPos)
      Convert world position to tile coordinates
    • worldToTilePosition

      public com.badlogic.gdx.math.GridPoint2 worldToTilePosition(float x, float y)
      Convert world position to tile coordinates
    • isValidTile

      public boolean isValidTile(com.badlogic.gdx.math.GridPoint2 tilePos)
      Check if tile coordinates are within grid bounds
    • isValidTile

      public boolean isValidTile(int x, int y)
      Check if tile coordinates are within grid bounds
    • getTileSize

      public float getTileSize()
      Get the size of each tile in world units
    • getMapBounds

      public com.badlogic.gdx.math.GridPoint2 getMapBounds()
      Get the dimensions of the grid in tiles
    • getWorldBounds

      public com.badlogic.gdx.math.Vector2 getWorldBounds()
      Get the total world size of the grid
    • getTileCenter

      public com.badlogic.gdx.math.Vector2 getTileCenter(com.badlogic.gdx.math.GridPoint2 tilePos)
      Get the center world position of a tile
    • getOrientation

      public GridComponent.GridOrientation getOrientation()
      Get the grid orientation