My Project
 
Loading...
Searching...
No Matches
Level Class Referenceabstract

#include <level.h>

Inheritance diagram for Level:
Collaboration diagram for Level:

Public Types

enum  Feeling { NONE , CHASM , WATER , GRASS }
 

Public Member Functions

 Level ()
 
virtual ~Level ()
 
void create ()
 
void clear ()
 
int pitCell ()
 
int randomRespawnCell ()
 
int adjustPos (int pos)
 
virtual std::string tilesTex ()
 
virtual std::string waterTex ()
 
void reset ()
 
std::vector< bool > updateFieldOfView (Char *c)
 
int tunnelTile ()
 
int randomDestination ()
 
void mobPress (Mob *mob)
 
Heapdrop (Item *item, int cell)
 
void uproot (int pos)
 
Plantplant (Plant::Seed *seed, int pos)
 
void press (int cell, Char *ch)
 
void destroy (int pos)
 
String tileName (int tile)
 
String tileDesc (int tile)
 
void addVisuals (Scene *scene)
 
virtual int nMobs ()
 

Static Public Member Functions

static int distance (int a, int b)
 
static bool adjacent (int a, int b)
 
static void set (int cell, int terrain)
 

Public Attributes

std::vector< int > map
 
std::vector< bool > visited
 
std::vector< bool > mapped
 
int viewDistance
 
Feeling feeling
 
int entrance
 
int exit
 
HashSet< Mob * > mobs
 
HashMap< std::string, Blob * > blobs
 
HashMap< int, Heap * > heaps
 
HashMap< int, Plant * > plants
 
int color1
 
int color2
 

Static Public Attributes

static const int WIDTH = 32
 
static const int HEIGHT = 32
 
static const int LENGTH = WIDTH * HEIGHT
 
static const int NEIGHBOURS4 [] = { -Level::WIDTH, +1, +Level::WIDTH, -1 }
 
static const int NEIGHBOURS8 [] = { +1, -1, +Level::WIDTH, -Level::WIDTH, +1 + Level::WIDTH, +1 - Level::WIDTH, -1 + Level::WIDTH, -1 - Level::WIDTH }
 
static const int NEIGHBOURS9 [] = { 0, +1, -1, +Level::WIDTH, -Level::WIDTH, +1 + Level::WIDTH, +1 - Level::WIDTH, -1 + Level::WIDTH, -1 - Level::WIDTH }
 
static bool resizingNeeded
 
static int loadedMapSize
 
static std::vector< bool > fieldOfView
 
static std::vector< bool > passable
 
static std::vector< bool > losBlocking
 
static std::vector< bool > flamable
 
static std::vector< bool > secret
 
static std::vector< bool > solid
 
static std::vector< bool > avoid
 
static std::vector< bool > water
 
static std::vector< bool > pit
 
static std::vector< bool > discoverable
 

Protected Member Functions

virtual bool build ()=0
 
virtual void decorate ()=0
 
virtual void createMobs ()=0
 
virtual void createItems ()=0
 

Static Protected Attributes

static const float TIME_TO_RESPAWN = 50
 
static bool pitRoomNeeded = false
 
static bool weakFloorCreated = false
 

Member Enumeration Documentation

◆ Feeling

Enumerator
NONE 
CHASM 
WATER 
GRASS 

Constructor & Destructor Documentation

◆ Level()

Level::Level ( )
Here is the call graph for this function:

◆ ~Level()

Level::~Level ( )
virtual
Here is the call graph for this function:

Member Function Documentation

◆ addVisuals()

void Level::addVisuals ( Scene * scene)

◆ adjacent()

bool Level::adjacent ( int a,
int b )
static
Here is the caller graph for this function:

◆ adjustPos()

int Level::adjustPos ( int pos)
Here is the caller graph for this function:

◆ build()

virtual bool Level::build ( )
protectedpure virtual

Implemented in RegularLevel.

Here is the caller graph for this function:

◆ clear()

void Level::clear ( )
Here is the caller graph for this function:

◆ create()

void Level::create ( )
Here is the call graph for this function:

◆ createItems()

virtual void Level::createItems ( )
protectedpure virtual

Implemented in RegularLevel, and SewerLevel.

Here is the caller graph for this function:

◆ createMobs()

virtual void Level::createMobs ( )
protectedpure virtual

Implemented in RegularLevel, and SewerLevel.

Here is the caller graph for this function:

◆ decorate()

virtual void Level::decorate ( )
protectedpure virtual

Implemented in SewerLevel.

Here is the caller graph for this function:

◆ destroy()

void Level::destroy ( int pos)
Here is the call graph for this function:

◆ distance()

int Level::distance ( int a,
int b )
static
Here is the caller graph for this function:

◆ drop()

Heap * Level::drop ( Item * item,
int cell )

◆ mobPress()

void Level::mobPress ( Mob * mob)

◆ nMobs()

virtual int Level::nMobs ( )
inlinevirtual

Reimplemented in RegularLevel.

◆ pitCell()

int Level::pitCell ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ plant()

Plant * Level::plant ( Plant::Seed * seed,
int pos )

◆ press()

void Level::press ( int cell,
Char * ch )
Here is the call graph for this function:

◆ randomDestination()

int Level::randomDestination ( )

◆ randomRespawnCell()

int Level::randomRespawnCell ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void Level::reset ( )

◆ set()

void Level::set ( int cell,
int terrain )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tileDesc()

String Level::tileDesc ( int tile)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tileName()

String Level::tileName ( int tile)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tilesTex()

virtual std::string Level::tilesTex ( )
inlinevirtual

Reimplemented in SewerLevel.

◆ tunnelTile()

int Level::tunnelTile ( )
Here is the caller graph for this function:

◆ updateFieldOfView()

std::vector< bool > Level::updateFieldOfView ( Char * c)
Here is the call graph for this function:

◆ uproot()

void Level::uproot ( int pos)

◆ waterTex()

virtual std::string Level::waterTex ( )
inlinevirtual

Reimplemented in SewerLevel.

Member Data Documentation

◆ avoid

std::vector< bool > Level::avoid
static

◆ blobs

HashMap<std::string, Blob*> Level::blobs

◆ color1

int Level::color1

◆ color2

int Level::color2

◆ discoverable

std::vector< bool > Level::discoverable
static

◆ entrance

int Level::entrance

◆ exit

int Level::exit

◆ feeling

Feeling Level::feeling

◆ fieldOfView

std::vector< bool > Level::fieldOfView
static

◆ flamable

std::vector< bool > Level::flamable
static

◆ heaps

HashMap<int, Heap*> Level::heaps

◆ HEIGHT

const int Level::HEIGHT = 32
static

◆ LENGTH

const int Level::LENGTH = WIDTH * HEIGHT
static

◆ loadedMapSize

int Level::loadedMapSize
static

◆ losBlocking

std::vector< bool > Level::losBlocking
static

◆ map

std::vector<int> Level::map

◆ mapped

std::vector<bool> Level::mapped

◆ mobs

HashSet<Mob*> Level::mobs

◆ NEIGHBOURS4

const int Level::NEIGHBOURS4 = { -Level::WIDTH, +1, +Level::WIDTH, -1 }
static

◆ NEIGHBOURS8

const int Level::NEIGHBOURS8 = { +1, -1, +Level::WIDTH, -Level::WIDTH, +1 + Level::WIDTH, +1 - Level::WIDTH, -1 + Level::WIDTH, -1 - Level::WIDTH }
static

◆ NEIGHBOURS9

const int Level::NEIGHBOURS9 = { 0, +1, -1, +Level::WIDTH, -Level::WIDTH, +1 + Level::WIDTH, +1 - Level::WIDTH, -1 + Level::WIDTH, -1 - Level::WIDTH }
static

◆ passable

std::vector< bool > Level::passable
static

◆ pit

std::vector< bool > Level::pit
static

◆ pitRoomNeeded

bool Level::pitRoomNeeded = false
staticprotected

◆ plants

HashMap<int, Plant*> Level::plants

◆ resizingNeeded

bool Level::resizingNeeded
static

◆ secret

std::vector< bool > Level::secret
static

◆ solid

std::vector< bool > Level::solid
static

◆ TIME_TO_RESPAWN

const float Level::TIME_TO_RESPAWN = 50
staticprotected

◆ viewDistance

int Level::viewDistance

◆ visited

std::vector<bool> Level::visited

◆ water

std::vector< bool > Level::water
static

◆ weakFloorCreated

bool Level::weakFloorCreated = false
staticprotected

◆ WIDTH

const int Level::WIDTH = 32
static

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