1
0
Fork 0
forked from NotAShelf/rogged
rogged/src/common.h
NotAShelf b381e2efbd
initial commit
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ie3b66d17f6f660c9b9a719210bd86f9f6a6a6964
2026-03-19 17:01:54 +03:00

63 lines
964 B
C

#ifndef COMMON_H
#define COMMON_H
#include "settings.h"
// Tile types
typedef enum { TILE_WALL, TILE_FLOOR, TILE_STAIRS } TileType;
// Room
typedef struct {
int x, y, w, h;
} Room;
// Map
typedef struct {
TileType tiles[MAP_HEIGHT][MAP_WIDTH];
Room rooms[MAX_ROOMS];
int room_count;
} Map;
// Dungeon
typedef struct {
int current_floor;
Room rooms[MAX_ROOMS];
int room_count;
} Dungeon;
// Item types
typedef enum { ITEM_POTION, ITEM_WEAPON, ITEM_ARMOR } ItemType;
// Item
typedef struct {
int x, y;
ItemType type;
int power;
int floor;
int picked_up;
} Item;
// Player
typedef struct {
int x, y;
int hp, max_hp;
int attack;
int defense;
int floor;
Item inventory[MAX_INVENTORY];
int inventory_count;
} Player;
// Enemy types
typedef enum { ENEMY_GOBLIN, ENEMY_SKELETON, ENEMY_ORC } EnemyType;
// Enemy
typedef struct {
int x, y;
int hp;
int attack;
int alive;
EnemyType type;
} Enemy;
#endif // COMMON_H