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

Method copyFloodFillToOtherSeats

source/entities/Tile.cpp:639–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

637}
638
639void Tile::copyFloodFillToOtherSeats(Seat* seatToCopy)
640{
641 if(seatToCopy->getTeamIndex() >= mFloodFillColor.size())
642 {
643 static bool logMsg = false;
644 if(!logMsg)
645 {
646 logMsg = true;
647 OD_LOG_ERR("Wrong floodfill seat index seatId=" + Helper::toString(seatToCopy->getId())
648 + ", tile=" + Tile::displayAsString(this)
649 + ", seatIndex=" + Helper::toString(seatToCopy->getTeamIndex()) + ", floodfillsize=" + Helper::toString(static_cast<uint32_t>(mFloodFillColor.size())));
650 }
651 return;
652 }
653
654 std::vector<uint32_t>& valuesToCopy = mFloodFillColor[seatToCopy->getTeamIndex()];
655 for(uint32_t indexFloodFill = 0; indexFloodFill < mFloodFillColor.size(); ++indexFloodFill)
656 {
657 if(seatToCopy->getTeamIndex() == indexFloodFill)
658 continue;
659
660 std::vector<uint32_t>& values = mFloodFillColor[indexFloodFill];
661 for(uint32_t intType = 0; intType < static_cast<uint32_t>(FloodFillType::nbValues); ++intType)
662 values[intType] = valuesToCopy[intType];
663
664 }
665}
666
667void Tile::logFloodFill() const
668{

Callers 1

enableFloodFillMethod · 0.80

Calls 3

getTeamIndexMethod · 0.80
toStringFunction · 0.50
getIdMethod · 0.45

Tested by

no test coverage detected