Renamed World:setAllowSleeping and World:getAllowSleeping to World:setSleepingAllowed and World:isSleepingAllowed (see issue #691, also consistent with the Body methods)

This commit is contained in:
Alex Szpakowski
2013-08-31 21:15:09 -03:00
parent 3ac0710544
commit 93a782d445
4 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -396,12 +396,12 @@ int World::getGravity(lua_State *L)
return 2;
}
void World::setAllowSleeping(bool allow)
void World::setSleepingAllowed(bool allow)
{
world->SetAllowSleeping(allow);
}
bool World::getAllowSleeping() const
bool World::isSleepingAllowed() const
{
return world->GetAllowSleeping();
}
+2 -2
View File
@@ -185,13 +185,13 @@ public:
* Sets whether this World allows sleep.
* @param allow True to allow, false to disallow.
**/
void setAllowSleeping(bool allow);
void setSleepingAllowed(bool allow);
/**
* Returns whether this World allows sleep.
* @return True if allowed, false if disallowed.
**/
bool getAllowSleeping() const;
bool isSleepingAllowed() const;
/**
* Returns whether this World is currently locked.
+6 -6
View File
@@ -87,18 +87,18 @@ int w_World_getGravity(lua_State *L)
return t->getGravity(L);
}
int w_World_setAllowSleeping(lua_State *L)
int w_World_setSleepingAllowed(lua_State *L)
{
World *t = luax_checkworld(L, 1);
bool b = luax_toboolean(L, 2);
t->setAllowSleeping(b);
t->setSleepingAllowed(b);
return 0;
}
int w_World_getAllowSleeping(lua_State *L)
int w_World_isSleepingAllowed(lua_State *L)
{
World *t = luax_checkworld(L, 1);
luax_pushboolean(L, t->getAllowSleeping());
luax_pushboolean(L, t->isSleepingAllowed());
return 1;
}
@@ -189,8 +189,8 @@ static const luaL_Reg functions[] =
{ "getContactFilter", w_World_getContactFilter },
{ "setGravity", w_World_setGravity },
{ "getGravity", w_World_getGravity },
{ "setAllowSleeping", w_World_setAllowSleeping },
{ "getAllowSleeping", w_World_getAllowSleeping },
{ "setSleepingAllowed", w_World_setSleepingAllowed },
{ "isSleepingAllowed", w_World_isSleepingAllowed },
{ "isLocked", w_World_isLocked },
{ "getBodyCount", w_World_getBodyCount },
{ "getJointCount", w_World_getJointCount },
+2 -2
View File
@@ -42,8 +42,8 @@ int w_World_setContactFilter(lua_State *L);
int w_World_getContactFilter(lua_State *L);
int w_World_setGravity(lua_State *L);
int w_World_getGravity(lua_State *L);
int w_World_setAllowSleeping(lua_State *L);
int w_World_getAllowSleeping(lua_State *L);
int w_World_setSleepingAllowed(lua_State *L);
int w_World_isSleepingAllowed(lua_State *L);
int w_World_isLocked(lua_State *L);
int w_World_getBodyCount(lua_State *L);
int w_World_getJointCount(lua_State *L);