Files
librefront/src/world.h
T
2025-09-08 19:39:12 +02:00

42 lines
701 B
C

#pragma once
#include <SDL3/SDL.h>
#include <glib-2.0/glib.h>
#include "util.h"
typedef enum TerrainType
{
TERRAIN_FLAT,
TERRAIN_HILL,
TERRAIN_MOUNTAIN
} TerrainType;
typedef enum BuildingType
{
BUILDING_NONE,
BUILDING_PORT,
BUILDING_CITY,
BUILDING_FORT
} BuildingType;
typedef struct MapTile
{
int player_id;
TerrainType terrain_type;
BuildingType building_type;
gboolean is_radiated;
gboolean is_defended;
} MapTile;
typedef struct World
{
unsigned int width, height;
GArray *tiles;
} World;
World *World_random (unsigned int width, unsigned int height);
void World_update (World *w);
void World_render (World *w, SDL_Renderer *renderer);