1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Net Packs BulkMoveArtifacts structure and BulkMoveArtifacts::applyCl

This commit is contained in:
SoundSSGood
2022-11-06 23:54:50 +02:00
parent d0895e30ef
commit 95ab343116
6 changed files with 152 additions and 17 deletions

View File

@@ -279,6 +279,28 @@ void MoveArtifact::applyCl(CClient *cl)
callInterfaceIfPresent(cl, dst.owningPlayer(), &IGameEventsReceiver::artifactMoved, src, dst);
}
void BulkMoveArtifacts::applyCl(CClient * cl)
{
auto & movingArts = artsPack0;
for (auto & slotToMove : movingArts.slots)
{
auto srcLoc = ArtifactLocation(movingArts.srcArtHolder, slotToMove.srcPos);
auto dstLoc = ArtifactLocation(movingArts.dstArtHolder, slotToMove.dstPos);
MoveArtifact(&srcLoc, &dstLoc).applyCl(cl);
}
if (artsPack1.has_value())
{
movingArts = artsPack1.value();
for (auto & slotToMove : movingArts.slots)
{
auto srcLoc = ArtifactLocation(movingArts.srcArtHolder, slotToMove.srcPos);
auto dstLoc = ArtifactLocation(movingArts.dstArtHolder, slotToMove.dstPos);
MoveArtifact(&srcLoc, &dstLoc).applyCl(cl);
}
}
}
void AssembledArtifact::applyCl(CClient *cl)
{
callInterfaceIfPresent(cl, al.owningPlayer(), &IGameEventsReceiver::artifactAssembled, al);