Implements marking opponents as seen.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-12-14 12:40:50 +01:00
parent c25d7b865e
commit 3baed93597
5 changed files with 58 additions and 2 deletions

View File

@@ -38,12 +38,24 @@ void BattleSide::SetChoice(BaseTurnChoice* choice) {
void BattleSide::SetCreature(Creature* creature, uint8_t index) {
auto old = _creatures[index];
if (old != nullptr){
if (old != nullptr) {
old->SetOnBattleField(false);
}
_creatures[index] = creature;
creature->SetBattleData(_battle, this);
creature->SetOnBattleField(true);
if (_battle == nullptr)
return;
for (auto side : _battle->GetSides()) {
if (side == this)
continue;
for (auto c : side->GetCreatures()) {
if (c != nullptr) {
c->MarkOpponentAsSeen(creature);
creature->MarkOpponentAsSeen(c);
}
}
}
}
bool BattleSide::CreatureOnSide(const Creature* creature) const {