battleloom-engine/src/data.h

169 lines
3.7 KiB
C

<<<<<<< HEAD
<<<<<<< HEAD
#pragma once
=======
>>>>>>> 8e3d2ca (add game structure)
=======
#pragma once
>>>>>>> 08f4a9f (draw function added)
#include <stdbool.h>
#define MAX_UNITS 100
#define MAX_BUILDINGS 50
#define MAX_PLAYERS 2
<<<<<<< HEAD
<<<<<<< HEAD
#define MAX_MISSIONS 10
#define MAX_RESOURCES 50
#define MAP_SIZE 100
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
bool isConstructed;
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
<<<<<<< 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 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];
bool isCompleted;
char objectives[5][100]; // Array of objectives with a maximum of 5 objectives
int experienceReward;
int goldReward;
int timeLimit; // Time limit for completing the mission (in seconds)
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];
Map currentMap;
Mission missions[MAX_MISSIONS];
<<<<<<< HEAD
int mapx, mapy;
} GameData;
// Structure representing building data
typedef struct {
int buildingID;
int maxHealth;
char name[50];
int x, y, w, h; // sprite position
int cost;
} BuildingData;
// Structure representing unit data
typedef struct {
int unitID;
int x, y, w, h; // sprite position
int maxHealth;
char name[50]; // Name of the unit
int range; // Type of attack (Melee, Ranged, Magic)
int damage; // Damage dealt by the unit
int lineOfSight; // Line of sight (LOS) of the unit
int cost; // Resource cost to create the unit
} UnitData;
typedef struct {
GameData data;
BuildingData buildings[100];
UnitData units[100];
} Game;
=======
} GameData;
>>>>>>> 8e3d2ca (add game structure)