Class HMIStrategy
java.lang.Object
be.belegkarnil.game.board.spectrangle.strategy.StrategyAdapter
be.belegkarnil.game.board.spectrangle.strategy.HMIStrategy
- All Implemented Interfaces:
Strategy
This class is a special a
Strategy class that is recognized by the GUI. This class allow
a human player to select a Piece and a position Point in order to play an Action.- Author:
- Belegkarnil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOverride theStrategy.plays(Player, Board, Player)and return what defined by the GUI interface after callingsetAction(Action)voidDefines the next action to playvoidDefines the next action to playvoidsetReplaceAction(Piece piece) Defines the next action to play as a Replace actionvoidDefines the next action as a skip actionMethods inherited from class be.belegkarnil.game.board.spectrangle.strategy.StrategyAdapter
register, unregister
-
Constructor Details
-
HMIStrategy
public HMIStrategy()Constructs aStrategythat interact with the GUI
-
-
Method Details
-
setSkipAction
public void setSkipAction()Defines the next action as a skip action -
setPiece
Defines the next action to play- Parameters:
piece- the piece to playposition- the position at which put the piecerotation- the rotation to apply on the piece
-
setReplaceAction
Defines the next action to play as a Replace action- Parameters:
piece- the piece to replace/swap
-
setAction
Defines the next action to play- Parameters:
action- the action to play
-
plays
Override theStrategy.plays(Player, Board, Player)and return what defined by the GUI interface after callingsetAction(Action)- Parameters:
myself- seeStrategy.plays(be.belegkarnil.game.board.spectrangle.Player, be.belegkarnil.game.board.spectrangle.Board, be.belegkarnil.game.board.spectrangle.Player)board- seeStrategy.plays(be.belegkarnil.game.board.spectrangle.Player, be.belegkarnil.game.board.spectrangle.Board, be.belegkarnil.game.board.spectrangle.Player)opponent- seeStrategy.plays(be.belegkarnil.game.board.spectrangle.Player, be.belegkarnil.game.board.spectrangle.Board, be.belegkarnil.game.board.spectrangle.Player)- Returns:
- The
Actiondefined by the GUI after callingsetAction(Action)
-