R-Type
R-Type project
RType::MapScript Class Reference

Public Member Functions

 MapScript (KapEngine::KEngine *_engine, bool _isLoadedByServer=false)
 
void loadScript (const std::string &scriptPath)
 Load map script. More...
 
void closeScript ()
 Close map script.
 
std::string getName () const
 Get map name. More...
 
std::string getAuthor () const
 Get map author. More...
 
std::string getDescription () const
 Get map description. More...
 
std::string getBannerPath () const
 Get map banner path. More...
 
std::vector< SpawnEnemygetSpawnedEnemies () const
 Get spawn enemies. More...
 
bool isModded () const
 Is Modded Map (new enemies, custom path, ...). More...
 
void spawnEnemy (KapEngine::SceneManagement::Scene &scene, const std::string &enemyName, float startPositionY, float startPositionX, int enemyHp)
 Spawn enemy. More...
 
void _setMapName (const std::string &name)
 
void _setMapAuthor (const std::string &author)
 
void _setMapDescription (const std::string &description)
 
void _setMapBannerPath (const std::string &bannerPath)
 
void _registerNewEnemy (Script::Enemy *enemy)
 
void _registerSpawnEnemy (const std::string &name, int spawnTime, float startPositionY, float startPositionX, int enemyHp)
 
void _instanciatePrefab (const std::string &prefabName, float positionX, float positionY)
 
KapEngine::Tools::Vector3 _updateEnemy (const std::string &enemyName, const KapEngine::Tools::Vector3 &position)
 

Member Function Documentation

◆ getAuthor()

std::string RType::MapScript::getAuthor ( ) const
inline

Get map author.

Returns
Map author

◆ getBannerPath()

std::string RType::MapScript::getBannerPath ( ) const
inline

Get map banner path.

Returns
Map banner path

◆ getDescription()

std::string RType::MapScript::getDescription ( ) const
inline

Get map description.

Returns
Map description

◆ getName()

std::string RType::MapScript::getName ( ) const
inline

Get map name.

Returns
Map name

◆ getSpawnedEnemies()

std::vector<SpawnEnemy> RType::MapScript::getSpawnedEnemies ( ) const
inline

Get spawn enemies.

Returns
Spawn enemies

◆ isModded()

bool MapScript::isModded ( ) const

Is Modded Map (new enemies, custom path, ...).

Returns
True if map is modded, false otherwise

◆ loadScript()

void MapScript::loadScript ( const std::string &  scriptPath)

Load map script.

Parameters
scriptPathPath to script
Exceptions
LuaExceptionIf script can't be loaded or if script is invalid.

◆ spawnEnemy()

void MapScript::spawnEnemy ( KapEngine::SceneManagement::Scene scene,
const std::string &  enemyName,
float  startPositionY,
float  startPositionX,
int  enemyHp 
)

Spawn enemy.

Parameters
sceneScene where enemy will be spawned
enemyNameName of the enemy (without "Enemy" suffix)
startPositionYStart position Y of the enemy
startPositionXStart position X of the enemy
enemyHpEnemy HP

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