Universität Ulm, Fakultät für Mathematik und Wirtschaftswissenschaften, SAI

SS 99 || Ferienprojekt zu Allgemeine Informatik II || Puzzle Library

DEFINITION PuzzlePlayers


DEFINITION PuzzlePlayers;
   
   IMPORT ChessClocks, Objects, PersistentObjects, Puzzle, Services;

   TYPE
      Interface = POINTER TO InterfaceRec;
      Player = POINTER TO PlayerRec;
      PlayerRec = RECORD (Services.ObjectRec) END;

      MakeMoveProc = PROCEDURE(player: Player;
                               situation: Puzzle.Situation;
		               clock: ChessClocks.ChessClock; (* may be NIL *)
			       game: Services.Object;
			       VAR move: Puzzle.Move): BOOLEAN;

      AcceptProc = PROCEDURE(player: Player; game: Services.Object): BOOLEAN;

      GameOverProc = PROCEDURE(player: Player; game: Services.Object);

      InterfaceRec =
	 RECORD
	    (Objects.ObjectRec)
	    makeMove: MakeMoveProc;
	    accept: AcceptProc;
	    gameOver: GameOverProc;
	 END;

   PROCEDURE Init(player: Player; if: Interface);

   PROCEDURE MakeMove(player: Player;
                      situation: Puzzle.Situation;
		      clock: ChessClocks.ChessClock; (* may be NIL *)
		      game: Services.Object;
		      VAR move: Puzzle.Move): BOOLEAN;

   PROCEDURE Accept(player: Player; game: Services.Object): BOOLEAN;

   PROCEDURE GameOver(player: Player; game: Services.Object);

END PuzzlePlayers.

SS 99 || Ferienprojekt zu Allgemeine Informatik II || Puzzle Library

Andreas Borchert, 26. Juli 1999