--------------------------------------------- GET START POSITION -----------------------------------------
| 87 | } |
| 88 | //--------------------------------------------- GET START POSITION ----------------------------------------- |
| 89 | TilePosition PlayerImpl::getStartLocation() const |
| 90 | { |
| 91 | // Clear last error |
| 92 | BroodwarImpl.setLastError(); |
| 93 | |
| 94 | // Return None if there is no start location |
| 95 | if (index >= BW::PLAYABLE_PLAYER_COUNT || BW::BWDATA::Game.startPositions[index] == BW::Positions::Origin) |
| 96 | return TilePositions::None; |
| 97 | |
| 98 | // Return unknown and set Access_Denied if the start location |
| 99 | // should not be made available. |
| 100 | if ( !BroodwarImpl.isReplay() && |
| 101 | BroodwarImpl.self()->isEnemy(const_cast<PlayerImpl*>(this)) && |
| 102 | !BroodwarImpl.isFlagEnabled(Flag::CompleteMapInformation) ) |
| 103 | { |
| 104 | BroodwarImpl.setLastError(Errors::Access_Denied); |
| 105 | return TilePositions::Unknown; |
| 106 | } |
| 107 | // return the start location as a tile position |
| 108 | return TilePosition(BW::BWDATA::Game.startPositions[index] - BW::Position((TILE_SIZE * 4) / 2, (TILE_SIZE * 3) / 2)); |
| 109 | } |
| 110 | //--------------------------------------------- IS VICTORIOUS ---------------------------------------------- |
| 111 | bool PlayerImpl::isVictorious() const |
| 112 | { |
no test coverage detected