Civilization
Public Member Functions | Friends | List of all members
shared::Map Class Reference

class Map - More...

#include <Map.hpp>

Public Member Functions

 Map (unsigned width=15, unsigned height=11)
 Map constructor. More...
 
std::shared_ptr< Hexagonoperator() (unsigned x, unsigned y)
 Operator to access a specific hexagon of the map. More...
 
unsigned getMapHeight ()
 
unsigned getMapWidth ()
 
void setMapHeight (unsigned height)
 
void setMapWidth (unsigned width)
 
void setWater (int x, int y)
 
void generateRandomMap (int seed)
 Function to generate a random map based on Perlin Noise. More...
 
void init ()
 
void addResource (int x, int y, int procent, ResourceEnum resource)
 

Friends

class boost::serialization::access
 

Detailed Description

class Map -

Constructor & Destructor Documentation

◆ Map()

Map::Map ( unsigned  width = 15,
unsigned  height = 11 
)

Map constructor.

Parameters
widthWidth of the map to instantiate
heightHeight of the map to instantiate

Member Function Documentation

◆ generateRandomMap()

void Map::generateRandomMap ( int  seed)

Function to generate a random map based on Perlin Noise.

Parameters
seedSeed to use for the random generation

◆ operator()()

std::shared_ptr< Hexagon > Map::operator() ( unsigned  x,
unsigned  y 
)

Operator to access a specific hexagon of the map.

Parameters
xX coordinate of the hexagon
yY coordinate of the hexagon
Returns
Pointer to the hexagon

The documentation for this class was generated from the following files: