1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-02 09:02:03 +02:00
vcmi/server/ServerNetPackVisitors.h
Alexander Wilms 522cb571b3 Remove redundant virtual specifiers
`grep -nr virtual | grep -v googletest | grep override > ../redundant_virtual.txt`

```python
import os

with open("../redundant_virtual.txt") as f:
    for line in f:
        print()
        line: str = line.strip()
        print(line)
        tmp = line.split(":")
        file = tmp[0].strip()
        code = tmp[-1].strip()
        print(file)
        print(code)
        new_code = code.replace("virtual ", "", 1)
        # https://superuser.com/a/802490/578501
        command = f"export FIND='{code}' && export REPLACE='{new_code}' && ruby -p -i -e \"gsub(ENV['FIND'], ENV['REPLACE'])\" {file}"
        os.system(command)
```
2024-02-10 20:46:13 +01:00

62 lines
2.2 KiB
C++

/*
* ServerNetPackVisitors.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#pragma once
#include "../lib/networkPacks/NetPackVisitor.h"
class ApplyGhNetPackVisitor : public VCMI_LIB_WRAP_NAMESPACE(ICPackVisitor)
{
private:
bool result;
CGameHandler & gh;
public:
ApplyGhNetPackVisitor(CGameHandler & gh)
:gh(gh), result(false)
{
}
bool getResult() const
{
return result;
}
void visitSaveGame(SaveGame & pack) override;
void visitGamePause(GamePause & pack) override;
void visitEndTurn(EndTurn & pack) override;
void visitDismissHero(DismissHero & pack) override;
void visitMoveHero(MoveHero & pack) override;
void visitCastleTeleportHero(CastleTeleportHero & pack) override;
void visitArrangeStacks(ArrangeStacks & pack) override;
void visitBulkMoveArmy(BulkMoveArmy & pack) override;
void visitBulkSplitStack(BulkSplitStack & pack) override;
void visitBulkMergeStacks(BulkMergeStacks & pack) override;
void visitBulkSmartSplitStack(BulkSmartSplitStack & pack) override;
void visitDisbandCreature(DisbandCreature & pack) override;
void visitBuildStructure(BuildStructure & pack) override;
void visitRecruitCreatures(RecruitCreatures & pack) override;
void visitUpgradeCreature(UpgradeCreature & pack) override;
void visitGarrisonHeroSwap(GarrisonHeroSwap & pack) override;
void visitExchangeArtifacts(ExchangeArtifacts & pack) override;
void visitBulkExchangeArtifacts(BulkExchangeArtifacts & pack) override;
void visitAssembleArtifacts(AssembleArtifacts & pack) override;
void visitEraseArtifactByClient(EraseArtifactByClient & pack) override;
void visitBuyArtifact(BuyArtifact & pack) override;
void visitTradeOnMarketplace(TradeOnMarketplace & pack) override;
void visitSetFormation(SetFormation & pack) override;
void visitHireHero(HireHero & pack) override;
void visitBuildBoat(BuildBoat & pack) override;
void visitQueryReply(QueryReply & pack) override;
void visitMakeAction(MakeAction & pack) override;
void visitDigWithHero(DigWithHero & pack) override;
void visitCastAdvSpell(CastAdvSpell & pack) override;
void visitPlayerMessage(PlayerMessage & pack) override;
};