28 lines
628 B
Java
28 lines
628 B
Java
package chess.controller;
|
|
|
|
import chess.controller.event.GameListener;
|
|
import chess.model.Game;
|
|
|
|
/**
|
|
* Abstract class, manage the execution and results of commands.
|
|
*/
|
|
|
|
public abstract class Command {
|
|
|
|
public enum CommandResult {
|
|
/**
|
|
* The command was successful. Should update display and switch player turn.
|
|
*/
|
|
Moved,
|
|
/** The command was successful. Should not update anything */
|
|
NotMoved,
|
|
/** The command was successful. Should only update display */
|
|
ActionNeeded,
|
|
/** The command was not successful */
|
|
NotAllowed;
|
|
}
|
|
|
|
public abstract CommandResult execute(Game game, GameListener outputSystem);
|
|
|
|
}
|