41 lines
901 B
C
41 lines
901 B
C
#ifndef PIXELTYPE_H
|
|
#define PIXELTYPE_H
|
|
|
|
enum PixelType {
|
|
WATER, GRASS, TREE, BERRIES, ROCK, IRON_ORE, // nature
|
|
FOOD, WOOD, STONE, IRON, SWORD, // resources
|
|
DUDE, DEAD_DUDE, // humans
|
|
SPAWN, WALL, ROAD, MARK, LIBRARY, // buildings
|
|
EMPTY = -1
|
|
};
|
|
|
|
struct PixelProperty
|
|
{
|
|
static bool isWalkable(PixelType target)
|
|
{
|
|
return target == GRASS
|
|
|| target == ROAD
|
|
|| target == MARK;
|
|
}
|
|
|
|
static bool isDestructible(PixelType target)
|
|
{
|
|
return target == DUDE
|
|
|| target == SPAWN
|
|
|| target == WALL
|
|
|| target == LIBRARY
|
|
|| target == ROAD;
|
|
}
|
|
|
|
static bool isResource(PixelType target)
|
|
{
|
|
return target == FOOD
|
|
|| target == WOOD
|
|
|| target == STONE
|
|
|| target == IRON
|
|
|| target == SWORD;
|
|
}
|
|
};
|
|
|
|
#endif // PIXELTYPE_H
|