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

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

DEFINITION PuzzleGames


DEFINITION PuzzleGames;

   IMPORT ChessClocks, Events, Iterators, Objects, Puzzle, PuzzlePlayers,
      Services;

   TYPE
      Game = POINTER TO GameRec;
      GameRec = RECORD (Services.ObjectRec) END;

      Event = POINTER TO EventRec;
      EventRec =
	 RECORD
	    (Events.EventRec)
	    game: Game;
	    moveNumber: INTEGER; (* counting from 0 *)
	    move: Puzzle.Move;
	    situation: Puzzle.Situation; (* after move *)
	 END;

   TYPE
      GetNamesProc = PROCEDURE (game: Game; VAR name1, name2: ARRAY OF CHAR);
      GetCurrentSituationProc = PROCEDURE (game: Game;
                 VAR situation: Puzzle.Situation);
      GetChessClockProc = PROCEDURE (game: Game;
                 VAR chessclock: ChessClocks.ChessClock);
      TakeInterestProc = PROCEDURE (game: Game;
                 VAR eventType: Events.EventType);
      IterateMovesProc = PROCEDURE (game: Game; VAR it: Iterators.Iterator);

      Interface = POINTER TO InterfaceRec;
      InterfaceRec =
	 RECORD
	    (Objects.ObjectRec)
	    getNames: GetNamesProc;
	    getCurrentSituation: GetCurrentSituationProc;
	    getChessClock: GetChessClockProc;
	    takeInterest: TakeInterestProc;
	    iterateMoves: IterateMovesProc;
	 END;

   PROCEDURE Init(game: Game; if: Interface);

   PROCEDURE GetNames(game: Game; VAR name1, name2: ARRAY OF CHAR);
   PROCEDURE GetCurrentSituation(game: Game; VAR situation: Puzzle.Situation);
   PROCEDURE GetChessClock(game: Game; VAR chessclock: ChessClocks.ChessClock);
   PROCEDURE TakeInterest(game: Game; VAR eventType: Events.EventType);
   PROCEDURE IterateMoves(game: Game; VAR it: Iterators.Iterator);

END PuzzleGames.

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

Andreas Borchert, 26. Juli 1999