fix gamedata
This commit is contained in:
parent
385d2a62cb
commit
d27c9bd1ef
1 changed files with 2 additions and 84 deletions
86
src/data.h
86
src/data.h
|
@ -1,64 +1,29 @@
|
||||||
<<<<<<< HEAD
|
|
||||||
<<<<<<< HEAD
|
|
||||||
#pragma once
|
#pragma once
|
||||||
=======
|
|
||||||
>>>>>>> 8e3d2ca (add game structure)
|
|
||||||
=======
|
|
||||||
#pragma once
|
|
||||||
>>>>>>> 08f4a9f (draw function added)
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#define MAX_UNITS 100
|
#define MAX_UNITS 100
|
||||||
#define MAX_BUILDINGS 50
|
#define MAX_BUILDINGS 50
|
||||||
#define MAX_PLAYERS 2
|
#define MAX_PLAYERS 2
|
||||||
<<<<<<< HEAD
|
|
||||||
<<<<<<< HEAD
|
|
||||||
#define MAX_MISSIONS 10
|
#define MAX_MISSIONS 10
|
||||||
#define MAX_RESOURCES 50
|
#define MAX_RESOURCES 50
|
||||||
#define MAP_SIZE 100
|
#define MAP_SIZE 100
|
||||||
|
|
||||||
typedef struct Player {
|
|
||||||
=======
|
|
||||||
|
|
||||||
typedef struct {
|
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;
|
int playerID;
|
||||||
char playerName[50];
|
char playerName[50];
|
||||||
int gold;
|
int gold;
|
||||||
int xp;
|
int xp;
|
||||||
} Player;
|
} Player;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
<<<<<<< HEAD
|
|
||||||
typedef struct Unit {
|
typedef struct Unit {
|
||||||
=======
|
|
||||||
typedef struct {
|
|
||||||
>>>>>>> 8e3d2ca (add game structure)
|
|
||||||
=======
|
|
||||||
typedef struct Unit {
|
|
||||||
>>>>>>> 0125c62 (update gamestructure)
|
|
||||||
int unitID;
|
int unitID;
|
||||||
int playerID;
|
int playerID;
|
||||||
int x, y; // Position
|
int x, y; // Position
|
||||||
int health;
|
int health;
|
||||||
} Unit;
|
} Unit;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
<<<<<<< HEAD
|
|
||||||
typedef struct Building {
|
|
||||||
=======
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
>>>>>>> 8e3d2ca (add game structure)
|
|
||||||
=======
|
|
||||||
typedef struct Building {
|
|
||||||
>>>>>>> 0125c62 (update gamestructure)
|
|
||||||
int buildingID;
|
int buildingID;
|
||||||
int playerID;
|
int playerID;
|
||||||
int x, y; // Position
|
int x, y; // Position
|
||||||
|
@ -66,45 +31,17 @@ typedef struct Building {
|
||||||
int health;
|
int health;
|
||||||
} Building;
|
} Building;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
<<<<<<< HEAD
|
|
||||||
typedef struct Map {
|
|
||||||
=======
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
>>>>>>> 8e3d2ca (add game structure)
|
|
||||||
=======
|
|
||||||
typedef struct Map {
|
|
||||||
>>>>>>> 0125c62 (update gamestructure)
|
|
||||||
int mapID;
|
int mapID;
|
||||||
char mapName[50];
|
char mapName[50];
|
||||||
int mapWidth;
|
int mapWidth;
|
||||||
int mapHeight;
|
int mapHeight;
|
||||||
<<<<<<< HEAD
|
int tileData[MAP_SIZE][MAP_SIZE];
|
||||||
<<<<<<< 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 tileData[MAP_SIZE][MAP_SIZE]; // 2D array for map tile indices
|
|
||||||
>>>>>>> 08f4a9f (draw function added)
|
|
||||||
int playerStartingPositions[MAX_PLAYERS][2]; // [x, y] coordinates for each player
|
int playerStartingPositions[MAX_PLAYERS][2]; // [x, y] coordinates for each player
|
||||||
int resourceLocations[MAX_RESOURCES][2]; // [x, y] coordinates for each resource
|
int resourceLocations[MAX_RESOURCES][2]; // [x, y] coordinates for each resource
|
||||||
} Map;
|
} Map;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
<<<<<<< HEAD
|
|
||||||
typedef struct Mission {
|
|
||||||
=======
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
>>>>>>> 8e3d2ca (add game structure)
|
|
||||||
=======
|
|
||||||
typedef struct Mission {
|
|
||||||
>>>>>>> 0125c62 (update gamestructure)
|
|
||||||
int missionID;
|
int missionID;
|
||||||
char missionName[50];
|
char missionName[50];
|
||||||
char missionDescription[100];
|
char missionDescription[100];
|
||||||
|
@ -119,24 +56,12 @@ typedef struct Mission {
|
||||||
bool hasSpecialConditions; // Flag indicating whether the mission has special conditions
|
bool hasSpecialConditions; // Flag indicating whether the mission has special conditions
|
||||||
} Mission;
|
} Mission;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
<<<<<<< HEAD
|
|
||||||
typedef struct GameData {
|
|
||||||
=======
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
>>>>>>> 8e3d2ca (add game structure)
|
|
||||||
=======
|
|
||||||
typedef struct GameData {
|
|
||||||
>>>>>>> 0125c62 (update gamestructure)
|
|
||||||
Player players[MAX_PLAYERS];
|
Player players[MAX_PLAYERS];
|
||||||
Unit units[MAX_UNITS];
|
Unit units[MAX_UNITS];
|
||||||
Building buildings[MAX_BUILDINGS];
|
Building buildings[MAX_BUILDINGS];
|
||||||
Map currentMap;
|
Map currentMap;
|
||||||
Mission missions[MAX_MISSIONS];
|
Mission missions[MAX_MISSIONS];
|
||||||
<<<<<<< HEAD
|
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
>>>>>>> 4b87dcb (ui)
|
|
||||||
int mapx, mapy;
|
int mapx, mapy;
|
||||||
} GameData;
|
} GameData;
|
||||||
|
|
||||||
|
@ -165,11 +90,4 @@ typedef struct {
|
||||||
GameData data;
|
GameData data;
|
||||||
BuildingData buildings[100];
|
BuildingData buildings[100];
|
||||||
UnitData units[100];
|
UnitData units[100];
|
||||||
<<<<<<< HEAD
|
|
||||||
} Game;
|
} Game;
|
||||||
=======
|
|
||||||
} GameData;
|
|
||||||
>>>>>>> 8e3d2ca (add game structure)
|
|
||||||
=======
|
|
||||||
} Game;
|
|
||||||
>>>>>>> 4b87dcb (ui)
|
|
||||||
|
|
Loading…
Reference in a new issue