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

Method getReachableBuildingsPerSeat

source/gamemap/GameMap.cpp:1898–1931  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1896}
1897
1898std::vector<Building*> GameMap::getReachableBuildingsPerSeat(Seat* seat,
1899 Tile *startTile, const Creature* creature)
1900{
1901 std::vector<Building*> returnList;
1902 for (Room* room : mRooms)
1903 {
1904 if (room->getSeat() != seat)
1905 continue;
1906
1907 if (room->getHP(nullptr) <= 0.0)
1908 continue;
1909
1910 if(!pathExists(creature, startTile, room->getCoveredTile(0)))
1911 continue;
1912
1913 returnList.push_back(room);
1914 }
1915
1916 for (Trap* trap : mTraps)
1917 {
1918 if (trap->getSeat() != seat)
1919 continue;
1920
1921 if (trap->getHP(nullptr) <= 0.0)
1922 continue;
1923
1924 if(!pathExists(creature, startTile, trap->getCoveredTile(0)))
1925 continue;
1926
1927 returnList.push_back(trap);
1928 }
1929
1930 return returnList;
1931}
1932
1933Room* GameMap::getRoomByName(const std::string& name)
1934{

Callers 3

handleGrabEntityMethod · 0.80
doUpkeepMethod · 0.80

Calls 3

getSeatMethod · 0.45
getHPMethod · 0.45
getCoveredTileMethod · 0.45

Tested by

no test coverage detected