package com.github.dtschust.zork.repl.actions; import com.github.dtschust.zork.ZorkGame; import com.github.dtschust.zork.repl.Action; import java.util.List; /** * The "Game Over" action marks the end of the game. */ public class GameOverAction implements Action { @Override public boolean matchesInput(List arguments) { return arguments.get(0).equals("Game") && arguments.get(1).equals("Over"); } @Override public int getMinimumArgCount() { return 2; } @Override public boolean run(ZorkGame game, List arguments) { System.out.println("Victory!"); game.setGameOver(); return true; } }