Esempio n. 1
0
static int tolua_PlayerData_PlayerData_getName00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"PlayerData",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  PlayerData* self = (PlayerData*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getName'", NULL);
#endif
  {
   const char* tolua_ret = (const char*)  self->getName();
   tolua_pushstring(tolua_S,(const char*)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'getName'.",&tolua_err);
 return 0;
#endif
}
Esempio n. 2
0
void SinglePlayerScene::setGameData(SingleGameData* game)
{
    m_game = game;
    m_game->retain();

    PlayerData *player = m_game->getPlayer();


    if (player->getGender() == GENDER_MALE)
    {
        m_framePrefix = "boy1_character/boy1_";
    }
    else
    {
        m_framePrefix = "girl1_character/girl1_";
    }

    _labelName->setString(player->getName());
    _labelScore->setString("0");
    _labelLevel->setString(StringUtils::format("Lvl %d", player->getLevel()));
}