lua/wrappers/game/lua_character.cpp
/**
	 * Sets the characters gender.
	 * Currently only supports "male" and "female", if it is not one of these
	 * the characters gender is not changed.
	 *
	 * @param string gender The gender to change to.
	 * @returns am.character This
	 */
Sets the characters gender.
Currently only supports "male" and "female", if it is not one of these
the characters gender is not changed.

@param string gender The gender to change to.
Sets the characters gender . Currently only supports " male " and " female " if it is not one of these the characters gender is not changed . @param string gender The gender to change to .
int Character_gender(lua_State *lua)
	{
		Character *obj = castUData<Character>(lua, 1);
		if (obj)
		{
			if (lua_gettop(lua) == 1)
			{
				lua_pushstring(lua, Gender::getGenderName(obj->getGender()));
				return 1;
			}
			else
			{
				Gender::GenderType gender = Gender::MAX_GENDER_LENGTH;
				if (lua_isnum(lua, 2))
				{
					gender = Gender::getGenderInt(lua_tointeger(lua, 2));
				}
				else if (lua_isstr(lua, 2))
				{
					gender = Gender::getGenderType(lua_tostring(lua, 2));
				}
				if (gender != Gender::MAX_GENDER_LENGTH) 
				{
					obj->setGender(gender);
					lua_first(lua);
				}
				return LuaState::expectedArgs(lua, "gender", "String genderName");
			}
		}
		return LuaState::expectedContext(lua, "gender", "am.character");
	}
int Character_gender ( lua_State * lua ) { Character * obj = castUData < Character > ( lua , 1 ) ; if ( obj ) { if ( lua_gettop ( lua ) == 1 ) { lua_pushstring ( lua , Gender :: getGenderName ( obj -> getGender ( ) ) ) ; return 1 ; } else { Gender :: GenderType gender = Gender :: MAX_GENDER_LENGTH ; if ( lua_isnum ( lua , 2 ) ) { gender = Gender :: getGenderInt ( lua_tointeger ( lua , 2 ) ) ; } else if ( lua_isstr ( lua , 2 ) ) { gender = Gender :: getGenderType ( lua_tostring ( lua , 2 ) ) ; } if ( gender != Gender :: MAX_GENDER_LENGTH ) { obj -> setGender ( gender ) ; lua_first ( lua ) ; } return LuaState :: expectedArgs ( lua , " " , " " ) ; } } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Sets the characters gender.
Sets the characters gender .