Documented most Map methods

This commit is contained in:
Foereaper
2014-08-11 23:25:27 +02:00
parent 81d9342822
commit e568c8f192

View File

@@ -9,8 +9,13 @@
namespace LuaMap namespace LuaMap
{ {
/* BOOLEAN */
#ifndef CLASSIC #ifndef CLASSIC
/**
* Returns 'true' if the &Map is an arena, false otherwise
*
* @return bool isArena
*/
int IsArena(lua_State* L, Map* map) int IsArena(lua_State* L, Map* map)
{ {
Eluna::Push(L, map->IsBattleArena()); Eluna::Push(L, map->IsBattleArena());
@@ -18,6 +23,11 @@ namespace LuaMap
} }
#endif #endif
/**
* Returns 'true' if the &Map is a battleground, false otherwise
*
* @return bool isBattleGround
*/
int IsBattleground(lua_State* L, Map* map) int IsBattleground(lua_State* L, Map* map)
{ {
#ifndef TRINITY #ifndef TRINITY
@@ -28,12 +38,22 @@ namespace LuaMap
return 1; return 1;
} }
/**
* Returns 'true' if the &Map is a dungeon, false otherwise
*
* @return bool isDungeon
*/
int IsDungeon(lua_State* L, Map* map) int IsDungeon(lua_State* L, Map* map)
{ {
Eluna::Push(L, map->IsDungeon()); Eluna::Push(L, map->IsDungeon());
return 1; return 1;
} }
/**
* Returns 'true' if the &Map is empty, false otherwise
*
* @return bool isEmpty
*/
int IsEmpty(lua_State* L, Map* map) int IsEmpty(lua_State* L, Map* map)
{ {
Eluna::Push(L, map->isEmpty()); Eluna::Push(L, map->isEmpty());
@@ -41,6 +61,11 @@ namespace LuaMap
} }
#ifndef CLASSIC #ifndef CLASSIC
/**
* Returns 'true' if the &Map is a heroic, false otherwise
*
* @return bool isHeroic
*/
int IsHeroic(lua_State* L, Map* map) int IsHeroic(lua_State* L, Map* map)
{ {
Eluna::Push(L, map->IsHeroic()); Eluna::Push(L, map->IsHeroic());
@@ -48,19 +73,35 @@ namespace LuaMap
} }
#endif #endif
/**
* Returns 'true' if the &Map is a raid, false otherwise
*
* @return bool isRaid
*/
int IsRaid(lua_State* L, Map* map) int IsRaid(lua_State* L, Map* map)
{ {
Eluna::Push(L, map->IsRaid()); Eluna::Push(L, map->IsRaid());
return 1; return 1;
} }
/* GETTERS */ /**
* Returns the name of the &Map
*
* @return string mapName
*/
int GetName(lua_State* L, Map* map) int GetName(lua_State* L, Map* map)
{ {
Eluna::Push(L, map->GetMapName()); Eluna::Push(L, map->GetMapName());
return 1; return 1;
} }
/**
* Returns the height of the &Map at the given X and Y coordinates
*
* @param float x
* @param float y
* @return float z
*/
int GetHeight(lua_State* L, Map* map) int GetHeight(lua_State* L, Map* map)
{ {
float x = Eluna::CHECKVAL<float>(L, 2); float x = Eluna::CHECKVAL<float>(L, 2);
@@ -76,6 +117,11 @@ namespace LuaMap
return 1; return 1;
} }
/**
* Returns the difficulty of the &Map
*
* @return int32 difficulty
*/
int GetDifficulty(lua_State* L, Map* map) int GetDifficulty(lua_State* L, Map* map)
{ {
#ifndef CLASSIC #ifndef CLASSIC
@@ -86,24 +132,48 @@ namespace LuaMap
return 1; return 1;
} }
/**
* Returns the instance id of the &Map
*
* @return uint32 instanceId
*/
int GetInstanceId(lua_State* L, Map* map) int GetInstanceId(lua_State* L, Map* map)
{ {
Eluna::Push(L, map->GetInstanceId()); Eluna::Push(L, map->GetInstanceId());
return 1; return 1;
} }
/**
* Returns the player count currently on the &Map
* Does not include gamemasters
*
* @return uint32 playerCount
*/
int GetPlayerCount(lua_State* L, Map* map) int GetPlayerCount(lua_State* L, Map* map)
{ {
Eluna::Push(L, map->GetPlayersCountExceptGMs()); Eluna::Push(L, map->GetPlayersCountExceptGMs());
return 1; return 1;
} }
/**
* Returns the id of the &Map
*
* @return uint32 mapId
*/
int GetMapId(lua_State* L, Map* map) int GetMapId(lua_State* L, Map* map)
{ {
Eluna::Push(L, map->GetId()); Eluna::Push(L, map->GetId());
return 1; return 1;
} }
/**
* Returns the area id of the &Map at the specified X, Y and Z coordinates
*
* @param float x
* @param float y
* @param float z
* @return uint32 areaId
*/
int GetAreaId(lua_State* L, Map* map) int GetAreaId(lua_State* L, Map* map)
{ {
float x = Eluna::CHECKVAL<float>(L, 2); float x = Eluna::CHECKVAL<float>(L, 2);