Roguelike
 All Classes Namespaces Functions Variables Typedefs Friends Pages
Public Member Functions | Protected Attributes | List of all members
Spawner Class Reference

#include <spawner.h>

Public Member Functions

 Spawner (int, int, int, EnemyType)
 
bool should_spawn ()
 
Enemyspawn_creep (int chunk_x, int chunk_y)
 
int get_x ()
 
int get_y ()
 
int get_depth ()
 

Protected Attributes

int x
 
int y
 
int depth
 
EnemyType enemy
 

Detailed Description

A class responsible for creating enemies. This class spawns enemies at a given location. Each spawner only spawns one type of enemy.

Member Function Documentation

int Spawner::get_depth ( )

Public accessor for the depth.

int Spawner::get_x ( )

Public accessor for the member x.

int Spawner::get_y ( )

Public accessor for the member y.

Enemy * Spawner::spawn_creep ( int  chunk_x,
int  chunk_y 
)

Spawns a new enemy.

Parameters
chunk_xThe x component of the chunk where the enemy should spawn.
chunk_yThe y component of the chunk where the enemey should spawn.
Returns
A new enemy based on the EnemyType.

Member Data Documentation

int Spawner::depth
protected

Depth of the spawner in the chunk.

EnemyType Spawner::enemy
protected

The type of enemy to spawn.

int Spawner::x
protected

X coordinate of the spawner.

int Spawner::y
protected

Y coordinate of the spawner.


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