Class ShipPartTileComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.areas.terrain.ShipPartTileComponent
All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable

public class ShipPartTileComponent extends Component
A tile that drops a ship part on destroy. Can contain a ship debris which must be destroyed first if it exists.
  • Constructor Details

    • ShipPartTileComponent

      public ShipPartTileComponent()
  • Method Details

    • create

      public void create()
      Description copied from class: Component
      Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished.
      Overrides:
      create in class Component
    • addShipDebris

      public void addShipDebris(Entity shipDebris)
      Set the ship debris associated with this tile.
      Parameters:
      shipDebris - entity to be added
    • addClueItem

      public void addClueItem(Entity shipClueItem)
      Set the ship clue item associated with this tile.
      Parameters:
      shipClueItem - entity to be added
    • write

      public void write(com.badlogic.gdx.utils.Json json)
      Specified by:
      write in interface com.badlogic.gdx.utils.Json.Serializable
      Overrides:
      write in class Component
    • read

      public void read(com.badlogic.gdx.utils.Json json, com.badlogic.gdx.utils.JsonValue jsonMap)
      Specified by:
      read in interface com.badlogic.gdx.utils.Json.Serializable
      Overrides:
      read in class Component