Class BlockTarget

All Implemented Interfaces:
Killer, PuzzleEntity, Cloneable, Iterable<String>, Serializable

public class BlockTarget extends AreaEntity implements PuzzleEntity
An entity representing a target for a pushable block
Author:
madmetzger
  • Constructor Details

    • BlockTarget

      public BlockTarget()
      Create a BlockTarget accepting any Block
      Parameters:
      x - x-coordinate
      y - y-coordinate
    • BlockTarget

      public BlockTarget(String shape)
      Create a shaped BlockTarget, that only accepts Blocks of a certain shape
      Parameters:
      x - x-coordinate
      y - y-coordinate
      shape - accepted shape
  • Method Details

    • generateRPClass

      public static void generateRPClass()
      Generate the RPClass
    • doesTrigger

      public boolean doesTrigger(Block b, Player p)
      Check if a Block would trigger this BlockTarget
      Parameters:
      b - the Block to check
      p -
      Returns:
      true iff the given Block would trigger this target
    • trigger

      public void trigger(Block b, Player p)
      Trigger this BlockTarget
      Parameters:
      b - The Block that was pushed on this target
      p - The Player who has pushed the triggering Block on this target
    • untrigger

      public void untrigger()
      Untriggeres this BlockTarget
    • getShape

      public String getShape()
      Get the shape of this BlockTarget
      Returns:
      the shape or null if this BlockTarget has no shape
    • setAction

      public void setAction(ChatAction action)
      Parameters:
      action - the action to set
    • setCondition

      public void setCondition(ChatCondition condition)
      Set the ChatCondition to check
      Parameters:
      condition - the condition to set
    • puzzleExpressionsUpdated

      public void puzzleExpressionsUpdated()
      Description copied from interface: PuzzleEntity
      invoked when the expressions of a PuzzleBuildingBlock have been updated. It is ensured that there was an actual change.
      Specified by:
      puzzleExpressionsUpdated in interface PuzzleEntity
    • setPuzzleBuildingBlock

      public void setPuzzleBuildingBlock(PuzzleBuildingBlock buildingBlock)
      Description copied from interface: PuzzleEntity
      sets the PuzzleBuildingBlock
      Specified by:
      setPuzzleBuildingBlock in interface PuzzleEntity
      Parameters:
      buildingBlock - PuzzleBuildingBlock