Ejemplo n.º 1
0
bool Map::IsEmpty(int x, int y)
{
	Building *bd = GetBuilding(x, y);
	if (bd->GetType() == NONE)
		return true;
	else
		return false;
}
Ejemplo n.º 2
0
void Map::DestroyBuilding(int x, int y)
{
	Building *bd = GetBuilding(x, y);
	if (bd->GetType() != NONE)
	{
		bd->Destroy();
		std::cout << "Building destroyed.\n";
	}
}
Ejemplo n.º 3
0
int Map::CreateBuilding(int x, int y, BUILDINGTYPE type, OWNER owner)
{
	Building *bd = GetBuilding(x, y);
	if (bd->GetType() == NONE)
	{
		bd->Create(type, owner);
		std::cout << "Building created.\n";
		return 1;
	}
	else
	{
		/*std::cout << "Cannot build.\n";*/
		return 0;
	}
}