Skip to content

Commit 05aa8b2

Browse files
committed
feature: create new structs
Created `Team`, `Player`, and `APIPlayer` structs.
1 parent 9161e23 commit 05aa8b2

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

src/macros.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
#ifndef SRC_MACROS_H_INCLUDED
22
#define SRC_MACROS_H_INCLUDED
33

4+
/* --------------------------------- Common --------------------------------- */
5+
46
#define DEVELOPMENT_TEAM "SQUASH"
57

68
#define TEAM_NAME_LENGTH 32
79

810
#define CONFIGURATION_PATH "./statics/configuration.txt"
911

12+
/* --------------------------------- Player --------------------------------- */
13+
14+
#define PLAYER_NAME_LENGTH 64
15+
16+
#define PLAYER_LAST_GAME_PLAYED_LENGTH 32
17+
1018
#endif // SRC_MACROS_H_INCLUDED

src/structs.h

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,29 @@
22
#ifndef SRC_STRUCTS_H_INCLUDED
33
#define SRC_STRUCTS_H_INCLUDED
44

5+
#include <stdlib.h>
6+
57
#include "./macros.h"
68

9+
/* --------------------------------- Common --------------------------------- */
10+
711
typedef struct {
8-
char name[TEAM_NAME_LENGTH];
12+
char name[TEAM_NAME_LENGTH]; // TODO: use a dynamic method.
913
} Team;
1014

15+
/* --------------------------------- Player --------------------------------- */
16+
17+
typedef struct {
18+
char name[PLAYER_NAME_LENGTH]; // TODO: use a dynamic method.
19+
size_t points;
20+
char assignedForm;
21+
size_t remainingTurns;
22+
} Player;
23+
24+
typedef struct {
25+
char name[PLAYER_NAME_LENGTH]; // TODO: use a dynamic method.
26+
int points;
27+
char lastGamePlayed[PLAYER_LAST_GAME_PLAYED_LENGTH]; // TODO: use a dynamic method.
28+
} APIPlayer;
29+
1130
#endif // SRC_STRUCTS_H_INCLUDED

0 commit comments

Comments
 (0)