From 602f177a8f9b7d1eef5dc28bd36878b31aa06789 Mon Sep 17 00:00:00 2001 From: Barry Kane Date: Sun, 12 Feb 2023 23:32:39 +0000 Subject: [PATCH] Added some more comments. - Commented the data structures in areadata.h and gamelogic.h. --- src/areadata.h | 10 ++++++---- src/gamelogic.h | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/areadata.h b/src/areadata.h index e983019..327db34 100644 --- a/src/areadata.h +++ b/src/areadata.h @@ -9,30 +9,32 @@ // -=[ Area/Paths: ]=-: // ==================== +// Let the compiler know that we're going to define these types: typedef struct playerPath playerPath; typedef struct playerArea playerArea; +// A path, which contains a name, and a pointer to the area which the player will travel to: struct playerPath { char pathName[32]; playerArea * areaToJoin; }; +// An area, containing a list of paths exiting from the area, and a name and description of the area: struct playerArea { list * pathList; char areaName[32]; 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); -// 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); -// 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); // TO BE IMPLEMENTED: diff --git a/src/gamelogic.h b/src/gamelogic.h index 631ef6b..cc672e4 100644 --- a/src/gamelogic.h +++ b/src/gamelogic.h @@ -12,6 +12,7 @@ // -=[ Data Structures ]=-: // ======================== +// An event for storing the information typedef struct commandEvent commandEvent; typedef struct commandEvent { @@ -83,6 +84,7 @@ int evaluateNextCommand(gameLogicParameters * parameters, commandQueue * queue); // -=[ Gameplay Primitives ]=-: // ============================ +// The possible outcomes of a check or challenge: typedef enum outcome { CRITICAL_FAILURE,