Added some more comments.

- Commented the data structures in areadata.h and gamelogic.h.
This commit is contained in:
Barry Kane 2023-02-12 23:32:39 +00:00
parent d0e4a8f9fc
commit 602f177a8f
2 changed files with 8 additions and 4 deletions

View File

@ -9,30 +9,32 @@
// -=[ Area/Paths: ]=-: // -=[ Area/Paths: ]=-:
// ==================== // ====================
// Let the compiler know that we're going to define these types:
typedef struct playerPath playerPath; typedef struct playerPath playerPath;
typedef struct playerArea playerArea; typedef struct playerArea playerArea;
// A path, which contains a name, and a pointer to the area which the player will travel to:
struct playerPath struct playerPath
{ {
char pathName[32]; char pathName[32];
playerArea * areaToJoin; playerArea * areaToJoin;
}; };
// An area, containing a list of paths exiting from the area, and a name and description of the area:
struct playerArea struct playerArea
{ {
list * pathList; list * pathList;
char areaName[32]; char areaName[32];
char areaDescription[MAX - 35]; char areaDescription[MAX - 35];
// playerPath * areaExits[16];
}; };
// Create an area given a name and description: // Create an area given a name and description, returning a pointer to the new area:
playerArea * createArea(char * nameString, char * descriptionString); playerArea * createArea(char * nameString, char * descriptionString);
// Create a path between two areas given two areas and two strings: // Create a path between two areas given two areas and two strings, adding it to the both area's list of paths:
int createPath(playerArea * fromArea, playerArea * toArea, char * fromDescription, char * toDescription); int createPath(playerArea * fromArea, playerArea * toArea, char * fromDescription, char * toDescription);
// Create a one-way path between two areas given two areas and a string: // Create a one-way path between two areas given two areas and a string, adding it to the first area's list of paths:
int createOneWayPath(playerArea * fromArea, playerArea * toArea, char * description); int createOneWayPath(playerArea * fromArea, playerArea * toArea, char * description);
// TO BE IMPLEMENTED: // TO BE IMPLEMENTED:

View File

@ -12,6 +12,7 @@
// -=[ Data Structures ]=-: // -=[ Data Structures ]=-:
// ======================== // ========================
// An event for storing the information
typedef struct commandEvent commandEvent; typedef struct commandEvent commandEvent;
typedef struct commandEvent typedef struct commandEvent
{ {
@ -83,6 +84,7 @@ int evaluateNextCommand(gameLogicParameters * parameters, commandQueue * queue);
// -=[ Gameplay Primitives ]=-: // -=[ Gameplay Primitives ]=-:
// ============================ // ============================
// The possible outcomes of a check or challenge:
typedef enum outcome typedef enum outcome
{ {
CRITICAL_FAILURE, CRITICAL_FAILURE,