mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Merge remote-tracking branch 'upstream/develop' into develop
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
#include "../lib/mapping/CMap.h"
|
||||
#include "../lib/mapping/CMapService.h"
|
||||
#include "../lib/modding/ModIncompatibility.h"
|
||||
#include "../lib/networkPacks/StackLocation.h"
|
||||
#include "../lib/pathfinder/CPathfinder.h"
|
||||
#include "../lib/pathfinder/PathfinderOptions.h"
|
||||
#include "../lib/pathfinder/TurnInfo.h"
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "../lib/StartInfo.h"
|
||||
#include "../lib/mapping/CMapHeader.h"
|
||||
#include "../lib/rmg/CMapGenOptions.h"
|
||||
#include "../lib/NetPackVisitor.h"
|
||||
#include "LobbyNetPackVisitors.h"
|
||||
#ifdef VCMI_ANDROID
|
||||
#include <jni.h>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../lib/NetPackVisitor.h"
|
||||
#include "../lib/networkPacks/NetPackVisitor.h"
|
||||
|
||||
class ClientPermissionsCheckerNetPackVisitor : public VCMI_LIB_WRAP_NAMESPACE(ICPackVisitor)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "CVCMIServer.h"
|
||||
#include "CGameHandler.h"
|
||||
|
||||
#include "../lib/NetPacksLobby.h"
|
||||
#include "../lib/serializer/Connection.h"
|
||||
#include "../lib/StartInfo.h"
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../lib/NetPackVisitor.h"
|
||||
#include "../lib/networkPacks/NetPackVisitor.h"
|
||||
|
||||
class ApplyGhNetPackVisitor : public VCMI_LIB_WRAP_NAMESPACE(ICPackVisitor)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
#include "queries/CQuery.h"
|
||||
|
||||
#include "../lib/gameState/CGameState.h"
|
||||
#include "../lib/NetPacks.h"
|
||||
#include "../lib/networkPacks/PacksForClientBattle.h"
|
||||
#include "../lib/networkPacks/SetStackEffect.h"
|
||||
|
||||
///ServerSpellCastEnvironment
|
||||
ServerSpellCastEnvironment::ServerSpellCastEnvironment(CGameHandler * gh)
|
||||
|
||||
@@ -15,10 +15,11 @@
|
||||
#include "processors/TurnOrderProcessor.h"
|
||||
#include "../lib/battle/BattleInfo.h"
|
||||
#include "../lib/gameState/CGameState.h"
|
||||
#include "../lib/networkPacks/PacksForClient.h"
|
||||
#include "../lib/networkPacks/PacksForClientBattle.h"
|
||||
#include "../lib/CPlayerState.h"
|
||||
#include "../lib/CStack.h"
|
||||
#include "../lib/StartInfo.h"
|
||||
#include "../lib/NetPacks.h"
|
||||
|
||||
TurnTimerHandler::TurnTimerHandler(CGameHandler & gh):
|
||||
gameHandler(gh)
|
||||
|
||||
@@ -18,10 +18,12 @@
|
||||
#include "../../lib/CStack.h"
|
||||
#include "../../lib/GameSettings.h"
|
||||
#include "../../lib/battle/CBattleInfoCallback.h"
|
||||
#include "../../lib/battle/CObstacleInstance.h"
|
||||
#include "../../lib/battle/IBattleState.h"
|
||||
#include "../../lib/battle/BattleAction.h"
|
||||
#include "../../lib/gameState/CGameState.h"
|
||||
#include "../../lib/NetPacks.h"
|
||||
#include "../../lib/networkPacks/PacksForClientBattle.h"
|
||||
#include "../../lib/networkPacks/SetStackEffect.h"
|
||||
#include "../../lib/spells/AbilityCaster.h"
|
||||
#include "../../lib/spells/CSpellHandler.h"
|
||||
#include "../../lib/spells/ISpellMechanics.h"
|
||||
@@ -852,6 +854,8 @@ int BattleActionProcessor::moveStack(const CBattleInfoCallback & battle, int sta
|
||||
|| start == battle::Unit::occupiedHex(dest, curStack->doubleWide(), curStack->unitSide()))
|
||||
passed.clear(); //Just empty passed, obstacles will handled automatically
|
||||
}
|
||||
if(dest == start) //If dest is equal to start, then we should handle obstacles for it anyway
|
||||
passed.clear(); //Just empty passed, obstacles will handled automatically
|
||||
//handling obstacle on the final field (separate, because it affects both flying and walking stacks)
|
||||
battle.handleObstacleTriggersForUnit(*gameHandler->spellEnv, *curStack, passed);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "../../lib/battle/IBattleState.h"
|
||||
#include "../../lib/gameState/CGameState.h"
|
||||
#include "../../lib/mapObjects/CGTownInstance.h"
|
||||
#include "../../lib/NetPacks.h"
|
||||
#include "../../lib/networkPacks/PacksForClientBattle.h"
|
||||
#include "../../lib/spells/BonusCaster.h"
|
||||
#include "../../lib/spells/ISpellMechanics.h"
|
||||
#include "../../lib/spells/ObstacleCasterProxy.h"
|
||||
|
||||
@@ -20,10 +20,14 @@
|
||||
|
||||
#include "../../lib/TerrainHandler.h"
|
||||
#include "../../lib/battle/CBattleInfoCallback.h"
|
||||
#include "../../lib/battle/CObstacleInstance.h"
|
||||
#include "../../lib/battle/BattleInfo.h"
|
||||
#include "../../lib/gameState/CGameState.h"
|
||||
#include "../../lib/mapping/CMap.h"
|
||||
#include "../../lib/mapObjects/CGHeroInstance.h"
|
||||
#include "../../lib/modding/IdentifierStorage.h"
|
||||
#include "../../lib/networkPacks/PacksForClient.h"
|
||||
#include "../../lib/networkPacks/PacksForClientBattle.h"
|
||||
#include "../../lib/CPlayerState.h"
|
||||
|
||||
BattleProcessor::BattleProcessor(CGameHandler * gameHandler)
|
||||
@@ -100,9 +104,6 @@ void BattleProcessor::startBattlePrimary(const CArmedInstance *army1, const CArm
|
||||
assert(gameHandler->gameState()->getBattle(army1->getOwner()) == nullptr);
|
||||
assert(gameHandler->gameState()->getBattle(army2->getOwner()) == nullptr);
|
||||
|
||||
engageIntoBattle(army1->tempOwner);
|
||||
engageIntoBattle(army2->tempOwner);
|
||||
|
||||
const CArmedInstance *armies[2];
|
||||
armies[0] = army1;
|
||||
armies[1] = army2;
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include "../../lib/battle/SideInBattle.h"
|
||||
#include "../../lib/gameState/CGameState.h"
|
||||
#include "../../lib/mapObjects/CGTownInstance.h"
|
||||
#include "../../lib/networkPacks/PacksForClientBattle.h"
|
||||
#include "../../lib/networkPacks/PacksForClient.h"
|
||||
#include "../../lib/serializer/Cast.h"
|
||||
#include "../../lib/spells/CSpellHandler.h"
|
||||
|
||||
|
||||
@@ -10,10 +10,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "../../lib/GameConstants.h"
|
||||
#include "../../lib/NetPacks.h"
|
||||
#include "../../lib/networkPacks/StackLocation.h"
|
||||
#include "../../lib/networkPacks/ArtifactLocation.h"
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
struct SideInBattle;
|
||||
struct BattleResult;
|
||||
class CBattleInfoCallback;
|
||||
class CGHeroInstance;
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
||||
class CBattleQuery;
|
||||
@@ -24,7 +28,6 @@ struct CasualtiesAfterBattle
|
||||
{
|
||||
using TStackAndItsNewCount = std::pair<StackLocation, int>;
|
||||
using TSummoned = std::map<CreatureID, TQuantity>;
|
||||
// enum {ERASE = -1};
|
||||
const CArmedInstance * army;
|
||||
std::vector<TStackAndItsNewCount> newStackCounts;
|
||||
std::vector<ArtifactLocation> removedWarMachines;
|
||||
@@ -37,7 +40,6 @@ struct CasualtiesAfterBattle
|
||||
|
||||
struct FinishingBattleHelper
|
||||
{
|
||||
// FinishingBattleHelper();
|
||||
FinishingBattleHelper(const CBattleInfoCallback & battle, const BattleResult & result, int RemainingBattleQueriesCount);
|
||||
|
||||
inline bool isDraw() const {return winnerSide == 2;}
|
||||
|
||||
@@ -16,9 +16,10 @@
|
||||
#include "../../lib/CHeroHandler.h"
|
||||
#include "../../lib/CPlayerState.h"
|
||||
#include "../../lib/GameSettings.h"
|
||||
#include "../../lib/NetPacks.h"
|
||||
#include "../../lib/StartInfo.h"
|
||||
#include "../../lib/mapObjects/CGTownInstance.h"
|
||||
#include "../../lib/mapObjects/CGHeroInstance.h"
|
||||
#include "../../lib/networkPacks/PacksForClient.h"
|
||||
#include "../../lib/gameState/CGameState.h"
|
||||
#include "../../lib/gameState/TavernHeroesPool.h"
|
||||
#include "../../lib/gameState/TavernSlot.h"
|
||||
|
||||
@@ -19,12 +19,13 @@
|
||||
#include "../../lib/modding/IdentifierStorage.h"
|
||||
#include "../../lib/CPlayerState.h"
|
||||
#include "../../lib/GameConstants.h"
|
||||
#include "../../lib/NetPacks.h"
|
||||
#include "../../lib/StartInfo.h"
|
||||
#include "../../lib/gameState/CGameState.h"
|
||||
#include "../../lib/mapObjects/CGTownInstance.h"
|
||||
#include "../../lib/modding/IdentifierStorage.h"
|
||||
#include "../../lib/modding/ModScope.h"
|
||||
#include "../../lib/networkPacks/PacksForClient.h"
|
||||
#include "../../lib/networkPacks/StackLocation.h"
|
||||
|
||||
PlayerMessageProcessor::PlayerMessageProcessor()
|
||||
:gameHandler(nullptr)
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "../CVCMIServer.h"
|
||||
|
||||
#include "../../lib/CPlayerState.h"
|
||||
#include "../../lib/NetPacks.h"
|
||||
#include "../../lib/pathfinder/CPathfinder.h"
|
||||
#include "../../lib/pathfinder/PathfinderOptions.h"
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "../battles/BattleProcessor.h"
|
||||
|
||||
#include "../../lib/battle/IBattleState.h"
|
||||
#include "../../lib/mapObjects/CGObjectInstance.h"
|
||||
#include "../../lib/networkPacks/PacksForServer.h"
|
||||
|
||||
void CBattleQuery::notifyObjectAboutRemoval(const CObjectVisitQuery & objectVisit) const
|
||||
{
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "CQuery.h"
|
||||
|
||||
#include "../../lib/NetPacks.h"
|
||||
#include "../../lib/networkPacks/PacksForClientBattle.h"
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
class IBattleInfo;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "../CGameHandler.h"
|
||||
|
||||
#include "../../lib/serializer/Cast.h"
|
||||
#include "../../lib/NetPacks.h"
|
||||
#include "../../lib/networkPacks/PacksForServer.h"
|
||||
|
||||
template <typename Container>
|
||||
std::string formatContainer(const Container & c, std::string delimeter = ", ", std::string opener = "(", std::string closer=")")
|
||||
|
||||
@@ -13,8 +13,24 @@
|
||||
#include "QueriesProcessor.h"
|
||||
#include "../CGameHandler.h"
|
||||
#include "../../lib/mapObjects/MiscObjects.h"
|
||||
#include "../../lib/mapObjects/CGHeroInstance.h"
|
||||
#include "../../lib/networkPacks/PacksForServer.h"
|
||||
#include "../../lib/serializer/Cast.h"
|
||||
|
||||
struct GetEngagedHeroIds
|
||||
{
|
||||
std::optional<ObjectInstanceID> operator()(const ConstTransitivePtr<CGHeroInstance> & h) const
|
||||
{
|
||||
return h->id;
|
||||
}
|
||||
std::optional<ObjectInstanceID> operator()(const ConstTransitivePtr<CStackInstance> & s) const
|
||||
{
|
||||
if(s->armyObj && s->armyObj->ID == Obj::HERO)
|
||||
return s->armyObj->id;
|
||||
return std::optional<ObjectInstanceID>();
|
||||
}
|
||||
};
|
||||
|
||||
TimerPauseQuery::TimerPauseQuery(CGameHandler * owner, PlayerColor player):
|
||||
CQuery(owner)
|
||||
{
|
||||
|
||||
@@ -10,8 +10,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "CQuery.h"
|
||||
#include "../../lib/networkPacks/PacksForClient.h"
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
class CGHeroInstance;
|
||||
class CGObjectInstance;
|
||||
class int3;
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
||||
#include "../../lib/NetPacks.h"
|
||||
|
||||
class TurnTimerHandler;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user