void BattleInfo::battle(Battle const & battle) { battleId_ = battle.id(); setMapImage(battle); setHeaderText(battle); }
void BattleInfo::userLeftBattle(User const & user, const Battle & battle) { if (battle.id() == battleId_) { setHeaderText(battle); } }
void BattleInfo::battleClosed(const Battle & battle) { if (battle.id() == battleId_) { reset(); } }
void BattleInfo::battleChanged(const Battle & battle) { if (battle.id() == battleId_) { if (currentMapImage_ != battle.mapName()) { setMapImage(battle); } setHeaderText(battle); } }
bool set_player_roll_point(Player* p, uint32_t battle_id, uint32_t roll_id, int32_t roll_flag, int32_t& roll_point) { Battle* btl = p->btl; if(btl->id() != battle_id){ return false; } battle_roll_data *pdata = btl->get_battle_roll_data_by_roll_id(roll_id); if(pdata == NULL){ return false; } bool ret = pdata->player_roll_point(roll_id, p->id, roll_point, roll_flag); if(ret == false){ return false; } ret = pdata->is_roll_finish(roll_id); return pdata->check_delete(); }