WorldSim  inDev
2D tile-based sandbox RPG with procedurally generated fantasy world simulator 🌏
Classes | Public Member Functions | Public Attributes | List of all members
World_Local Class Reference

#include <World_Local.hpp>

Inheritance diagram for World_Local:
Inheritance graph
[legend]
Collaboration diagram for World_Local:
Collaboration graph
[legend]

Public Member Functions

std::string getTerrainName ()
 
void addInfluence (Tribe *tribe, int amount)
 
void removeInfluence (Tribe *tribe, int amount)
 
void degradeInfluence (int amount)
 
void destroyInfluence (Tribe *tribe)
 
TribegetDominantInfluence ()
 
int getDominantInfluenceValue ()
 
 World_Local ()
 
virtual ~World_Local ()
 
void unload ()
 
void init (const int _globalX, const int _globalY, const enumBiome _biomeID, const int _seed, const int _hasRiver)
 
LocalTileoperator() (int _x, int _y)
 
bool isSafe (int, int)
 
bool isSafe (HasXY *)
 
bool isSafe (WorldObject *)
 
bool isLand ()
 
bool generate (bool cache=true, World_Local *c0=0, World_Local *c1=0, World_Local *c2=0, World_Local *c3=0, World_Local *c4=0, World_Local *c5=0, World_Local *c6=0, World_Local *c7=0)
 
bool generateSubterranean ()
 
bool save ()
 
std::string getSaveData ()
 
bool load ()
 
void generateHeightMap (const short int c0=0, const short int c1=0, const short int c2=0, const short int c3=0, const short int c4=0, const short int c5=0, const short int c6=0, const short int c7=0, const unsigned int _seed=0)
 
CreaturespawnCreature ()
 
bool put (WorldObject *, int, int, bool subterranean=false)
 
bool put (Item *, int, int, bool subterranean=false)
 
bool put (Character *, int, int, bool subterranean=false)
 
bool put (Creature *, int, int, bool subterranean=false)
 
bool put (WorldObject *_object, HasXY *_xy, bool subterranean=false)
 
bool put (Item *_object, HasXY *_xy, bool subterranean=false)
 
bool put (Character *_object, HasXY *_xy, bool subterranean=false)
 
bool put (Creature *_object, HasXY *_xy, bool subterranean=false)
 
bool put (WorldObject *_object, HasXY _xy, bool subterranean=false)
 
bool put (Item *_object, HasXY _xy, bool subterranean=false)
 
bool put (Character *_object, HasXY _xy, bool subterranean=false)
 
bool put (Creature *_object, HasXY _xy, bool subterranean=false)
 
bool put (Static *_static, int, int, bool subterranean=false)
 
bool put (Static *_static, HasXY _xy, bool subterranean=false)
 
bool put (Static *_static, HasXY *_xy, bool subterranean=false)
 
bool remove (WorldObject *)
 
bool remove (Item *)
 
bool remove (Character *)
 
bool remove (Creature *)
 
bool erase (WorldObject *)
 
bool erase (Item *)
 
bool erase (Character *)
 
bool erase (Creature *)
 
bool contains (WorldObject *)
 
bool contains (Character *)
 
bool moveObject (WorldObject *, int, int)
 
bool moveObject (Character *, int, int)
 
bool moveObject (WorldObject *, const enumDirection)
 
bool moveDown (WorldObject *)
 
bool moveDown (Character *)
 
bool moveUp (WorldObject *)
 
bool moveUp (Character *)
 
bool wander (WorldObject *)
 
bool wander (Character *)
 
bool wander (Creature *)
 
Vector< Character * > * getAdjacentCharacters (int, int)
 
HasXY * getRandomTile ()
 
HasXY * getRandomNeighbor (HasXY *)
 
Vector< HasXY * > * getRandomWalk (int)
 
bool isBlockingView (int, int)
 
Vector< HasXY * > * rayTraceLOS (int, int, const int, const bool subterranean=false)
 
Vector< HasXY2< unsigned long int > * > * rayTraceLOS (long unsigned int, long unsigned int, const int)
 
void rayTrace (int, int, int, int, Vector< HasXY *> *, const bool subterranean=false)
 
void incrementTicks (int nTicks)
 
void updateTickBacklog (Calendar)
 
virtual Texture * currentTexture ()
 

Public Attributes

Data * data
 
Data_Subterranean * dataSubterranean
 
AbstractData * abstractData
 
World_Biomebiome
 
unsigned long int accessNumber
 
Texture texFar
 
Calendar localDate
 
bool hasCave
 
bool hasRuin
 
std::atomic< short int > globalX_TS
 
std::atomic< short int > globalY_TS
 
short int globalX
 
short int globalY
 
std::atomic< bool > threadAccess
 
std::atomic< bool > initialized
 
std::atomic< bool > active
 
int testValue
 
short int baseMetal
 
short int baseFertility
 
bool canMove
 
short int landID
 
short int biomeID
 
short int hasRiver
 
char riverConnections
 
unsigned int nFloraGrass
 
unsigned int nFloraGood
 
unsigned int nFloraDifficult
 
unsigned short int centerHeight
 
ArrayS2< char > aHeightDiff
 
ArrayS2< int > aFullHeight
 
short int nX
 
short int nY
 
long long unsigned int ticksBacklog
 
enumBiome baseBiome
 
Vector< Creature * > vCreature
 
Vector< Character * > vCharacter
 
Vector< Item * > vItem
 
Vector< WorldObject * > vObjectGeneric
 

Constructor & Destructor Documentation

◆ World_Local()

World_Local::World_Local ( )

Implementation of World_Local.hpp

◆ ~World_Local()

World_Local::~World_Local ( )
virtual

Member Function Documentation

◆ addInfluence()

void World_Local::addInfluence ( Tribe tribe,
int  amount 
)

◆ contains() [1/2]

bool World_Local::contains ( WorldObject _target)

◆ contains() [2/2]

bool World_Local::contains ( Character _target)

◆ currentTexture()

Texture * World_Local::currentTexture ( )
virtual

◆ degradeInfluence()

void World_Local::degradeInfluence ( int  amount)

◆ destroyInfluence()

void World_Local::destroyInfluence ( Tribe tribe)

◆ erase() [1/4]

bool World_Local::erase ( WorldObject _object)

◆ erase() [2/4]

bool World_Local::erase ( Item _item)

◆ erase() [3/4]

bool World_Local::erase ( Character _character)

◆ erase() [4/4]

bool World_Local::erase ( Creature _creature)

◆ generate()

bool World_Local::generate ( bool  cache = true,
World_Local c0 = 0,
World_Local c1 = 0,
World_Local c2 = 0,
World_Local c3 = 0,
World_Local c4 = 0,
World_Local c5 = 0,
World_Local c6 = 0,
World_Local c7 = 0 
)

std::cout<<"Nobiome\n";

◆ generateHeightMap()

void World_Local::generateHeightMap ( const short int  c0 = 0,
const short int  c1 = 0,
const short int  c2 = 0,
const short int  c3 = 0,
const short int  c4 = 0,
const short int  c5 = 0,
const short int  c6 = 0,
const short int  c7 = 0,
const unsigned int  _seed = 0 
)

◆ generateSubterranean()

bool World_Local::generateSubterranean ( )

◆ getAdjacentCharacters()

Vector< Character * > * World_Local::getAdjacentCharacters ( int  _x,
int  _y 
)

◆ getDominantInfluence()

Tribe * World_Local::getDominantInfluence ( )

◆ getDominantInfluenceValue()

int World_Local::getDominantInfluenceValue ( )

◆ getRandomNeighbor()

HasXY * World_Local::getRandomNeighbor ( HasXY *  _source)

◆ getRandomTile()

HasXY * World_Local::getRandomTile ( )

◆ getRandomWalk()

Vector< HasXY * > * World_Local::getRandomWalk ( int  _nSteps)

◆ getSaveData()

std::string World_Local::getSaveData ( )

◆ getTerrainName()

std::string World_Local::getTerrainName ( )

◆ incrementTicks()

void World_Local::incrementTicks ( int  nTicks)

◆ init()

void World_Local::init ( const int  _globalX,
const int  _globalY,
const enumBiome  _biomeID,
const int  _seed = 0,
const int  _hasRiver = -1 
)

◆ isBlockingView()

bool World_Local::isBlockingView ( int  _x,
int  _y 
)

◆ isLand()

bool World_Local::isLand ( )

◆ isSafe() [1/3]

bool World_Local::isSafe ( int  _x,
int  _y 
)

◆ isSafe() [2/3]

bool World_Local::isSafe ( HasXY *  xy)

◆ isSafe() [3/3]

bool World_Local::isSafe ( WorldObject _object)

◆ load()

bool World_Local::load ( )

◆ moveDown() [1/2]

bool World_Local::moveDown ( WorldObject _object)

◆ moveDown() [2/2]

bool World_Local::moveDown ( Character _object)

◆ moveObject() [1/3]

bool World_Local::moveObject ( WorldObject _object,
int  newX,
int  newY 
)

◆ moveObject() [2/3]

bool World_Local::moveObject ( Character _object,
int  newX,
int  newY 
)

◆ moveObject() [3/3]

bool World_Local::moveObject ( WorldObject ,
const enumDirection  direction 
)

◆ moveUp() [1/2]

bool World_Local::moveUp ( WorldObject _object)

◆ moveUp() [2/2]

bool World_Local::moveUp ( Character _object)

◆ operator()()

LocalTile * World_Local::operator() ( int  _x,
int  _y 
)
inline

◆ put() [1/15]

bool World_Local::put ( WorldObject _object,
int  _x,
int  _y,
bool  subterranean = false 
)

◆ put() [2/15]

bool World_Local::put ( Item _item,
int  _x,
int  _y,
bool  subterranean = false 
)

◆ put() [3/15]

bool World_Local::put ( Character _character,
int  _x,
int  _y,
bool  subterranean = false 
)

◆ put() [4/15]

bool World_Local::put ( Creature _creature,
int  _x,
int  _y,
bool  subterranean = false 
)

◆ put() [5/15]

bool World_Local::put ( WorldObject _object,
HasXY *  _xy,
bool  subterranean = false 
)

◆ put() [6/15]

bool World_Local::put ( Item _object,
HasXY *  _xy,
bool  subterranean = false 
)

◆ put() [7/15]

bool World_Local::put ( Character _object,
HasXY *  _xy,
bool  subterranean = false 
)

◆ put() [8/15]

bool World_Local::put ( Creature _object,
HasXY *  _xy,
bool  subterranean = false 
)

◆ put() [9/15]

bool World_Local::put ( WorldObject _object,
HasXY  _xy,
bool  subterranean = false 
)

◆ put() [10/15]

bool World_Local::put ( Item _object,
HasXY  _xy,
bool  subterranean = false 
)

◆ put() [11/15]

bool World_Local::put ( Character _object,
HasXY  _xy,
bool  subterranean = false 
)

◆ put() [12/15]

bool World_Local::put ( Creature _object,
HasXY  _xy,
bool  subterranean = false 
)

◆ put() [13/15]

bool World_Local::put ( Static _static,
int  _x,
int  _y,
bool  subterranean = false 
)

◆ put() [14/15]

bool World_Local::put ( Static _static,
HasXY  _xy,
bool  subterranean = false 
)

◆ put() [15/15]

bool World_Local::put ( Static _static,
HasXY *  _xy,
bool  subterranean = false 
)

◆ rayTrace()

void World_Local::rayTrace ( int  _x1,
int  _y1,
int  _x2,
int  _y2,
Vector< HasXY *> *  vVisibleTiles,
const bool  subterranean = false 
)

◆ rayTraceLOS() [1/2]

Vector< HasXY * > * World_Local::rayTraceLOS ( int  _x,
int  _y,
const int  RANGE,
const bool  subterranean = false 
)

◆ rayTraceLOS() [2/2]

Vector< HasXY2< unsigned long int > * > * World_Local::rayTraceLOS ( long unsigned int  _x,
long unsigned int  _y,
const int  RANGE 
)

◆ remove() [1/4]

bool World_Local::remove ( WorldObject _object)

◆ remove() [2/4]

bool World_Local::remove ( Item _item)

◆ remove() [3/4]

bool World_Local::remove ( Character _character)

◆ remove() [4/4]

bool World_Local::remove ( Creature _creature)

◆ removeInfluence()

void World_Local::removeInfluence ( Tribe tribe,
int  amount 
)

◆ save()

bool World_Local::save ( )

◆ spawnCreature()

Creature* World_Local::spawnCreature ( )

◆ unload()

void World_Local::unload ( )

◆ updateTickBacklog()

void World_Local::updateTickBacklog ( Calendar  _currentDate)

◆ wander() [1/3]

bool World_Local::wander ( WorldObject _object)

◆ wander() [2/3]

bool World_Local::wander ( Character _object)

◆ wander() [3/3]

bool World_Local::wander ( Creature _object)

Member Data Documentation

◆ abstractData

AbstractData* World_Local::abstractData

◆ accessNumber

unsigned long int World_Local::accessNumber

◆ active

std::atomic<bool> World_Local::active

◆ aFullHeight

ArrayS2<int> World_Local::aFullHeight

◆ aHeightDiff

ArrayS2<char> World_Local::aHeightDiff

◆ baseBiome

enumBiome World_Local::baseBiome

◆ baseFertility

short int World_Local::baseFertility

◆ baseMetal

short int World_Local::baseMetal

◆ biome

World_Biome* World_Local::biome

◆ biomeID

short int World_Local::biomeID

◆ canMove

bool World_Local::canMove

◆ centerHeight

unsigned short int World_Local::centerHeight

◆ data

Data* World_Local::data

◆ dataSubterranean

Data_Subterranean* World_Local::dataSubterranean

◆ globalX

short int World_Local::globalX

◆ globalX_TS

std::atomic<short int> World_Local::globalX_TS

◆ globalY

short int World_Local::globalY

◆ globalY_TS

std::atomic<short int> World_Local::globalY_TS

◆ hasCave

bool World_Local::hasCave

◆ hasRiver

short int World_Local::hasRiver

◆ hasRuin

bool World_Local::hasRuin

◆ initialized

std::atomic<bool> World_Local::initialized

◆ landID

short int World_Local::landID

◆ localDate

Calendar World_Local::localDate

◆ nFloraDifficult

unsigned int World_Local::nFloraDifficult

◆ nFloraGood

unsigned int World_Local::nFloraGood

◆ nFloraGrass

unsigned int World_Local::nFloraGrass

◆ nX

short int World_Local::nX

◆ nY

short int World_Local::nY

◆ riverConnections

char World_Local::riverConnections

◆ testValue

int World_Local::testValue

◆ texFar

Texture World_Local::texFar

◆ threadAccess

std::atomic<bool> World_Local::threadAccess

◆ ticksBacklog

long long unsigned int World_Local::ticksBacklog

◆ vCharacter

Vector<Character*> World_Local::vCharacter

◆ vCreature

Vector<Creature*> World_Local::vCreature

◆ vItem

Vector<Item*> World_Local::vItem

◆ vObjectGeneric

Vector<WorldObject*> World_Local::vObjectGeneric

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