MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / playerSelects

Method playerSelects

source/gamemap/GameMap.cpp:2948–3028  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2946}
2947
2948void GameMap::playerSelects(std::vector<GameEntity*>& entities, int tileX1, int tileY1, int tileX2,
2949 int tileY2, SelectionTileAllowed tileAllowed, SelectionEntityWanted entityWanted, Player* player)
2950{
2951 std::vector<Tile*> tiles = rectangularRegion(tileX1, tileY1, tileX2, tileY2);
2952 for(Tile* tile : tiles)
2953 {
2954 switch(tileAllowed)
2955 {
2956 case SelectionTileAllowed::groundClaimedOwned:
2957 {
2958 if(tile->isFullTile())
2959 continue;
2960
2961 if(tile->getSeat() == nullptr)
2962 continue;
2963
2964 if(!tile->isClaimed())
2965 continue;
2966
2967 if(player->getSeat() != tile->getSeat())
2968 continue;
2969
2970 break;
2971 }
2972 case SelectionTileAllowed::groundClaimedAllied:
2973 {
2974 if(tile->isFullTile())
2975 continue;
2976
2977 if(tile->getSeat() == nullptr)
2978 continue;
2979
2980 if(!tile->isClaimed())
2981 continue;
2982
2983 if(!player->getSeat()->isAlliedSeat(tile->getSeat()))
2984 continue;
2985
2986 break;
2987 }
2988 case SelectionTileAllowed::groundClaimedNotEnemy:
2989 {
2990 if(tile->isFullTile())
2991 continue;
2992
2993 if(tile->getSeat() == nullptr)
2994 continue;
2995
2996 if(tile->isClaimed() && !player->getSeat()->isAlliedSeat(tile->getSeat()))
2997 continue;
2998
2999 break;
3000 }
3001 case SelectionTileAllowed::groundTiles:
3002 {
3003 if(tile->isFullTile())
3004 continue;
3005

Callers 3

checkSpellCastMethod · 0.80
checkSpellCastMethod · 0.80
checkSpellCastMethod · 0.80

Calls 6

isFullTileMethod · 0.80
isClaimedMethod · 0.80
isAlliedSeatMethod · 0.80
fillWithEntitiesMethod · 0.80
toStringFunction · 0.50
getSeatMethod · 0.45

Tested by

no test coverage detected