In order to structure the files that make up PACS the API has been put in one file. This file is called PACSInterface.def. As you can see this is a (XDS) definition file. It only contains procedure headings, type definitions and constants. You can (or have to) use all of these to build your program. You can do this by IMPORTing the elements that you need in your file(s). Let us take short look at some of the element of the API.
ObjectEn = (NO_EL, APPLE, BONUS, MINE, EATER, GHOST, HUNTER, EXPLORER);
ElEn = [NO_EL .. MINE];
PlTypeEn = [EATER..EXPLORER];
DirEn = (UP, RIGHT, DOWN, LEFT); CampEn = (WHITE, BLACK); PropRc = RECORD (* properties of a player *) camp: CampEn; plType: PlTypeEn; id: CARDINAL; pos: PosRc; nbrMoves: [0..MAX_NBR_MOVES]; nbrMoves: [0..MAX_NBR_MOVES]; nbrApples: [0..MAX_NBR_APPLES_EATER_CAN_CARRY]; nbrWalls: CARDINAL; wasKilled: BOOLEAN; END;The first type is used to represent directions. The CampEn type is defined in order to distinguish the teams in the arena. The PropRc type is used by PACS to give information about the players. So, you can see that the record contains:
PlBehaviourPr = PROCEDURE (PropRc, ViewRcPt): MoveRcPt;
PROCEDURE WrDirEn(dir: DirEn); PROCEDURE WrCampEn(camp: CampEn); PROCEDURE OppositeDir(dir: DirEn): DirEn; PROCEDURE IsHome(pos: PosRc): BOOLEAN; PROCEDURE IsWall(pos: PosRc; dir: DirEn): BOOLEAN;OppositeDir return the opposite direction of a give direction. Is home on the other hand return TRUE if the given position is indeed a home cell. The procedure IsWall allows you to detect whether moving in a given direction and given a position in the arena will make your player hit the wall.