Class Gate


public class Gate extends BlockEntity
A gate wired to a channel: open while the channel is on (or off, when inverted). Switches turn channels on and off.
  • Constructor Details

    • Gate

      public Gate(String id, int x, int y, int w, int h, int channel, boolean inverted)

      Creates a gate.

      Parameters
      • id: the id
      • x: left, fixed point, on a tile edge
      • y: top, fixed point, on a tile edge
      • w: width, whole tiles, fixed point
      • h: height, whole tiles, fixed point
      • channel: the channel, 0 to 31
      • inverted: true to be open while the channel is off
  • Method Details

    • getPhase

      public int getPhase()
      Description copied from class: LevelEntity

      A small number the view reads to pick a frame: open or closed, lit or not, how cracked. The default is 0.

      Returns

      the visual phase

      Overrides:
      getPhase in class LevelEntity
    • onAdded

      public void onAdded(PlatformWorld world)
      Description copied from class: LevelEntity

      Called once when the entity is added to a world, before the first step: the place to write solid cells. The default does nothing.

      Parameters
      • world: the world
      Overrides:
      onAdded in class LevelEntity
    • step

      public void step(PlatformWorld world)
      Description copied from class: LevelEntity

      Advances one tick. The default does nothing.

      Parameters
      • world: the world
      Overrides:
      step in class LevelEntity