| 1703 | } |
| 1704 | |
| 1705 | std::vector<GameEntity*> GameMap::getVisibleForce(const std::vector<Tile*>& visibleTiles, Seat* seat, bool enemyForce) |
| 1706 | { |
| 1707 | std::vector<GameEntity*> returnList; |
| 1708 | |
| 1709 | // Loop over the visible tiles |
| 1710 | for (Tile* tile : visibleTiles) |
| 1711 | { |
| 1712 | if(tile == nullptr) |
| 1713 | { |
| 1714 | OD_LOG_ERR("unexpected null tile"); |
| 1715 | continue; |
| 1716 | } |
| 1717 | |
| 1718 | if(enemyForce) |
| 1719 | { |
| 1720 | tile->fillWithEntities(returnList, SelectionEntityWanted::creatureAliveEnemyAttackable, seat->getPlayer()); |
| 1721 | Building* building = tile->getCoveringBuilding(); |
| 1722 | if((building != nullptr) && |
| 1723 | (!building->getSeat()->isAlliedSeat(seat)) && |
| 1724 | (building->isAttackable(tile, seat)) && |
| 1725 | (std::find(returnList.begin(), returnList.end(), building) == returnList.end())) |
| 1726 | { |
| 1727 | returnList.push_back(building); |
| 1728 | } |
| 1729 | } |
| 1730 | else |
| 1731 | { |
| 1732 | tile->fillWithEntities(returnList, SelectionEntityWanted::creatureAliveAllied, seat->getPlayer()); |
| 1733 | Building* building = tile->getCoveringBuilding(); |
| 1734 | if((building != nullptr) && |
| 1735 | (building->getSeat()->isAlliedSeat(seat)) && |
| 1736 | (std::find(returnList.begin(), returnList.end(), building) == returnList.end())) |
| 1737 | { |
| 1738 | returnList.push_back(building); |
| 1739 | } |
| 1740 | } |
| 1741 | } |
| 1742 | |
| 1743 | return returnList; |
| 1744 | } |
| 1745 | |
| 1746 | std::vector<GameEntity*> GameMap::getVisibleCreatures(const std::vector<Tile*>& visibleTiles, Seat* seat, bool enemyCreatures) |
| 1747 | { |
nothing calls this directly
no test coverage detected