update gamestructure

This commit is contained in:
Rysertio 2024-02-15 21:30:27 +06:00
parent 73ca24c36b
commit 6b2517604e
1 changed files with 32 additions and 0 deletions

View File

@ -8,6 +8,7 @@
#define MAX_BUILDINGS 50
#define MAX_PLAYERS 2
<<<<<<< HEAD
<<<<<<< HEAD
#define MAX_MISSIONS 10
#define MAX_RESOURCES 50
#define MAP_SIZE 100
@ -17,28 +18,43 @@ typedef struct Player {
typedef struct {
>>>>>>> 8e3d2ca (add game structure)
=======
#define MAX_MISSIONS 10
#define MAX_RESOURCES 50
#define MAP_SIZE 100
typedef struct Player {
>>>>>>> 0125c62 (update gamestructure)
int playerID;
char playerName[50];
int gold;
int xp;
} Player;
<<<<<<< HEAD
<<<<<<< HEAD
typedef struct Unit {
=======
typedef struct {
>>>>>>> 8e3d2ca (add game structure)
=======
typedef struct Unit {
>>>>>>> 0125c62 (update gamestructure)
int unitID;
int playerID;
int x, y; // Position
int health;
} Unit;
<<<<<<< HEAD
<<<<<<< HEAD
typedef struct Building {
=======
typedef struct {
>>>>>>> 8e3d2ca (add game structure)
=======
typedef struct Building {
>>>>>>> 0125c62 (update gamestructure)
int buildingID;
int playerID;
int x, y; // Position
@ -46,29 +62,41 @@ typedef struct {
int health;
} Building;
<<<<<<< HEAD
<<<<<<< HEAD
typedef struct Map {
=======
typedef struct {
>>>>>>> 8e3d2ca (add game structure)
=======
typedef struct Map {
>>>>>>> 0125c62 (update gamestructure)
int mapID;
char mapName[50];
int mapWidth;
int mapHeight;
<<<<<<< HEAD
<<<<<<< HEAD
int tileData[MAP_SIZE][MAP_SIZE]; // 2D array for map tile indices
=======
int tileData[MAX_MAP_WIDTH][MAX_MAP_HEIGHT];
>>>>>>> 8e3d2ca (add game structure)
=======
int tileData[MAP_SIZE][MAP_SIZE]; // Assuming 2D array for resource coordinates
>>>>>>> 0125c62 (update gamestructure)
int playerStartingPositions[MAX_PLAYERS][2]; // [x, y] coordinates for each player
int resourceLocations[MAX_RESOURCES][2]; // [x, y] coordinates for each resource
} Map;
<<<<<<< HEAD
<<<<<<< HEAD
typedef struct Mission {
=======
typedef struct {
>>>>>>> 8e3d2ca (add game structure)
=======
typedef struct Mission {
>>>>>>> 0125c62 (update gamestructure)
int missionID;
char missionName[50];
char missionDescription[100];
@ -83,11 +111,15 @@ typedef struct {
bool hasSpecialConditions; // Flag indicating whether the mission has special conditions
} Mission;
<<<<<<< HEAD
<<<<<<< HEAD
typedef struct GameData {
=======
typedef struct {
>>>>>>> 8e3d2ca (add game structure)
=======
typedef struct GameData {
>>>>>>> 0125c62 (update gamestructure)
Player players[MAX_PLAYERS];
Unit units[MAX_UNITS];
Building buildings[MAX_BUILDINGS];