Added Weather documentation

This commit is contained in:
Foereaper
2014-08-09 16:42:44 +02:00
parent 5273c53f09
commit e17d6355bb

View File

@@ -9,14 +9,35 @@
namespace LuaWeather namespace LuaWeather
{ {
/* GETTERS */ /**
* Returns the Zone ID of the &Weather as an uint32.
*
* @return uint32 ZoneID
*/
int GetZoneId(lua_State* L, Weather* weather) int GetZoneId(lua_State* L, Weather* weather)
{ {
Eluna::Push(L, weather->GetZone()); Eluna::Push(L, weather->GetZone());
return 1; return 1;
} }
/* SETTERS */ /**
* Sets the &Weather type based on &Weather type and grade supplied.
*
* <pre>
* enum WeatherType
* {
* WEATHER_TYPE_FINE = 0,
* WEATHER_TYPE_RAIN = 1,
* WEATHER_TYPE_SNOW = 2,
* WEATHER_TYPE_STORM = 3,
* WEATHER_TYPE_THUNDERS = 86,
* WEATHER_TYPE_BLACKRAIN = 90
* };
* </pre>
*
* @param uint32 type : the &Weather type, see above available weather types
* @param float grade : the intensity/grade of the &Weather, ranges from 0 to 1
*/
int SetWeather(lua_State* L, Weather* weather) int SetWeather(lua_State* L, Weather* weather)
{ {
uint32 weatherType = Eluna::CHECKVAL<uint32>(L, 2); uint32 weatherType = Eluna::CHECKVAL<uint32>(L, 2);
@@ -26,6 +47,11 @@ namespace LuaWeather
return 0; return 0;
} }
/**
* Sends a &Weather update to the &Player supplied.
*
* @param &Player
*/
int SendWeatherUpdateToPlayer(lua_State* L, Weather* weather) int SendWeatherUpdateToPlayer(lua_State* L, Weather* weather)
{ {
Player* player = Eluna::CHECKOBJ<Player>(L, 2); Player* player = Eluna::CHECKOBJ<Player>(L, 2);
@@ -34,13 +60,27 @@ namespace LuaWeather
return 0; return 0;
} }
/* OTHER */ /**
* Regenerates the &Weather, causing it to change based on the below statistics.
*
* 30% - No change
* 30% - &Weather gets better (if not fine) or change &Weather type
* 30% - &Weather worsens (if not fine)
* 10% - Radical change (if not fine)
*
* @return bool Changed : returns 'true' if &Weather changed
*/
int Regenerate(lua_State* L, Weather* weather) int Regenerate(lua_State* L, Weather* weather)
{ {
Eluna::Push(L, weather->ReGenerate()); Eluna::Push(L, weather->ReGenerate());
return 1; return 1;
} }
/**
* Sends a &Weather update to the all &Player in the zone.
*
* @param bool : Returns 'true' if weather changed for any &Player in the zone, 'false' if no &Player is within the zone
*/
int UpdateWeather(lua_State* L, Weather* weather) int UpdateWeather(lua_State* L, Weather* weather)
{ {
Eluna::Push(L, weather->UpdateWeather()); Eluna::Push(L, weather->UpdateWeather());