void Player::LoadFromJson(const Json::Value &jsonObj, Space *space) { Pi::player = this; Ship::LoadFromJson(jsonObj, space); InitCockpit(); registerEquipChangeListener(this); }
Player::Player(ShipType::Id shipId): Ship(shipId) { SetController(new PlayerShipController()); InitCockpit(); lua_State *l = Lua::manager->GetLuaState(); LUA_DEBUG_START(l); LuaObject<Player>::PushToLua(this); lua_pushcclosure(l, onEquipChangeListener, 1); LuaRef lr(Lua::manager->GetLuaState(), -1); ScopedTable(m_equipSet).CallMethod("AddListener", lr); lua_pop(l, 1); LUA_DEBUG_END(l, 0); }
void Player::SetShipType(const ShipType::Id &shipId) { Ship::SetShipType(shipId); registerEquipChangeListener(this); InitCockpit(); }
Player::Player(ShipType::Id shipId): Ship(shipId) { SetController(new PlayerShipController()); InitCockpit(); registerEquipChangeListener(this); }
void Player::Load(Serializer::Reader &rd, Space *space) { Pi::player = this; Ship::Load(rd, space); InitCockpit(); }