1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fix more includes and move SideInBattle / SiegeInfo into battle

This commit is contained in:
Arseniy Shestakov 2017-06-29 02:02:05 +03:00
parent ab4c848169
commit 2ce02202c1
18 changed files with 66 additions and 62 deletions

View File

@ -145,6 +145,10 @@
<Unit filename="battle/CPlayerBattleCallback.h" />
<Unit filename="battle/ReachabilityInfo.cpp" />
<Unit filename="battle/ReachabilityInfo.h" />
<Unit filename="battle/SideInBattle.cpp" />
<Unit filename="battle/SideInBattle.h" />
<Unit filename="battle/SiegeInfo.cpp" />
<Unit filename="battle/SiegeInfo.h" />
<Unit filename="CArtHandler.cpp" />
<Unit filename="CArtHandler.h" />
<Unit filename="CBonusTypeHandler.cpp" />
@ -215,10 +219,6 @@
<Unit filename="ResourceSet.cpp" />
<Unit filename="ResourceSet.h" />
<Unit filename="ScopeGuard.h" />
<Unit filename="SideInBattle.cpp" />
<Unit filename="SideInBattle.h" />
<Unit filename="SiegeInfo.cpp" />
<Unit filename="SiegeInfo.h" />
<Unit filename="StartInfo.h" />
<Unit filename="StdInc.h">
<Option compile="1" />

View File

@ -211,8 +211,8 @@
<ClCompile Include="serializer\JsonDeserializer.cpp" />
<ClCompile Include="serializer\JsonSerializeFormat.cpp" />
<ClCompile Include="serializer\JsonSerializer.cpp" />
<ClCompile Include="SideInBattle.cpp" />
<ClCompile Include="SiegeInfo.cpp" />
<ClCompile Include="battle\SideInBattle.cpp" />
<ClCompile Include="battle\SiegeInfo.cpp" />
<ClCompile Include="spells\CSpellHandler.cpp" />
<ClCompile Include="spells\ISpellMechanics.cpp" />
<ClCompile Include="spells\AdventureSpellMechanics.cpp" />
@ -415,8 +415,8 @@
<ClInclude Include="serializer\JsonDeserializer.h" />
<ClInclude Include="serializer\JsonSerializeFormat.h" />
<ClInclude Include="serializer\JsonSerializer.h" />
<ClInclude Include="SideInBattle.h" />
<ClInclude Include="SiegeInfo.h" />
<ClInclude Include="battle\SideInBattle.h" />
<ClInclude Include="battle\SiegeInfo.h" />
<ClInclude Include="spells\AdventureSpellMechanics.h" />
<ClInclude Include="spells\BattleSpellMechanics.h" />
<ClInclude Include="spells\CDefaultSpellMechanics.h" />

View File

@ -267,8 +267,8 @@
<ClCompile Include="serializer\CTypeList.cpp" />
<ClCompile Include="serializer\Connection.cpp" />
<ClCompile Include="CStack.cpp" />
<ClCompile Include="SideInBattle.cpp" />
<ClCompile Include="SiegeInfo.cpp" />
<ClCompile Include="battle\SideInBattle.cpp" />
<ClCompile Include="battle\SiegeInfo.cpp" />
<ClCompile Include="battle\BattleInfo.cpp" />
</ItemGroup>
<ItemGroup>
@ -686,10 +686,10 @@
<ClInclude Include="CStack.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="SideInBattle.h">
<ClInclude Include="battle\SideInBattle.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="SiegeInfo.h">
<ClInclude Include="battle\SiegeInfo.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>

View File

@ -7,9 +7,9 @@
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "../StdInc.h"
#include "AccessibilityInfo.h"
#include "CStack.h"
#include "../CStack.h"
bool AccessibilityInfo::accessible(BattleHex tile, const CStack * stack) const
{

View File

@ -8,9 +8,9 @@
*
*/
#include "StdInc.h"
#include "../StdInc.h"
#include "BattleAction.h"
#include "CStack.h"
#include "../CStack.h"
using namespace Battle;

View File

@ -7,9 +7,9 @@
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "../StdInc.h"
#include "BattleAttackInfo.h"
#include "CStack.h"
#include "../CStack.h"
BattleAttackInfo::BattleAttackInfo(const CStack * Attacker, const CStack * Defender, bool Shooting)

View File

@ -7,7 +7,7 @@
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "../StdInc.h"
#include "BattleHex.h"
BattleHex::BattleHex() : hex(INVALID) {}

View File

@ -7,13 +7,13 @@
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "../StdInc.h"
#include "BattleInfo.h"
#include "CStack.h"
#include "CHeroHandler.h"
#include "NetPacks.h"
#include "filesystem/Filesystem.h"
#include "mapObjects/CGTownInstance.h"
#include "../CStack.h"
#include "../CHeroHandler.h"
#include "../NetPacks.h"
#include "../filesystem/Filesystem.h"
#include "../mapObjects/CGTownInstance.h"
const CStack * BattleInfo::getNextStack() const
{

View File

@ -7,13 +7,13 @@
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "../StdInc.h"
#include "CBattleInfoCallback.h"
#include "CStack.h"
#include "../CStack.h"
#include "BattleInfo.h"
#include "NetPacks.h"
#include "spells/CSpellHandler.h"
#include "mapObjects/CGTownInstance.h"
#include "../NetPacks.h"
#include "../spells/CSpellHandler.h"
#include "../mapObjects/CGTownInstance.h"
namespace SiegeStuffThatShouldBeMovedToHandlers // <=== TODO
{

View File

@ -7,12 +7,12 @@
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "../StdInc.h"
#include "CBattleInfoEssentials.h"
#include "CStack.h"
#include "../CStack.h"
#include "BattleInfo.h"
#include "NetPacks.h"
#include "mapObjects/CGTownInstance.h"
#include "../NetPacks.h"
#include "../mapObjects/CGTownInstance.h"
ETerrainType CBattleInfoEssentials::battleTerrainType() const
{

View File

@ -7,10 +7,10 @@
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "../StdInc.h"
#include "CCallbackBase.h"
#include "BattleInfo.h"
#include "CGameState.h"
#include "../CGameState.h"
bool CCallbackBase::duringBattle() const
{

View File

@ -1,9 +1,9 @@
#include "StdInc.h"
#include "../StdInc.h"
#include "CObstacleInstance.h"
#include "CHeroHandler.h"
#include "CTownHandler.h"
#include "VCMI_Lib.h"
#include "spells/CSpellHandler.h"
#include "../CHeroHandler.h"
#include "../CTownHandler.h"
#include "../VCMI_Lib.h"
#include "../spells/CSpellHandler.h"
/*
* CObstacleInstance.cpp, part of VCMI engine

View File

@ -7,10 +7,10 @@
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "../StdInc.h"
#include "CPlayerBattleCallback.h"
#include "CStack.h"
#include "CGameState.h"
#include "../CStack.h"
#include "../CGameState.h"
bool CPlayerBattleCallback::battleCanFlee() const
{

View File

@ -8,9 +8,9 @@
*
*/
#include "StdInc.h"
#include "../StdInc.h"
#include "ReachabilityInfo.h"
#include "CStack.h"
#include "../CStack.h"
ReachabilityInfo::Parameters::Parameters()

View File

@ -7,9 +7,9 @@
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "../StdInc.h"
#include "SideInBattle.h"
#include "mapObjects/CArmedInstance.h"
#include "../mapObjects/CArmedInstance.h"
SideInBattle::SideInBattle()
{
@ -20,7 +20,7 @@ SideInBattle::SideInBattle()
enchanterCounter = 0;
}
void SideInBattle::init(const CGHeroInstance *Hero, const CArmedInstance *Army)
void SideInBattle::init(const CGHeroInstance * Hero, const CArmedInstance * Army)
{
hero = Hero;
armyObject = Army;

View File

@ -8,7 +8,7 @@
*
*/
#pragma once
#include "GameConstants.h"
#include "../GameConstants.h"
class CGHeroInstance;
class CArmedInstance;
@ -16,15 +16,15 @@ class CArmedInstance;
struct DLL_LINKAGE SideInBattle
{
PlayerColor color;
const CGHeroInstance *hero; //may be NULL if army is not commanded by hero
const CArmedInstance *armyObject; //adv. map object with army that participates in battle; may be same as hero
const CGHeroInstance * hero; //may be NULL if army is not commanded by hero
const CArmedInstance * armyObject; //adv. map object with army that participates in battle; may be same as hero
ui8 castSpellsCount; //how many spells each side has cast this turn
std::vector<const CSpell *> usedSpellsHistory; //every time hero casts spell, it's inserted here -> eagle eye skill
si16 enchanterCounter; //tends to pass through 0, so sign is needed
SideInBattle();
void init(const CGHeroInstance *Hero, const CArmedInstance *Army);
void init(const CGHeroInstance * Hero, const CArmedInstance * Army);
template <typename Handler> void serialize(Handler &h, const int version)

View File

@ -7,13 +7,13 @@
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "../StdInc.h"
#include "SiegeInfo.h"
SiegeInfo::SiegeInfo()
{
for (int i = 0; i < wallState.size(); ++i)
for(int i = 0; i < wallState.size(); ++i)
{
wallState[i] = EWallState::NONE;
}
@ -22,14 +22,18 @@ SiegeInfo::SiegeInfo()
EWallState::EWallState SiegeInfo::applyDamage(EWallState::EWallState state, unsigned int value)
{
if (value == 0)
if(value == 0)
return state;
switch (applyDamage(state, value - 1))
switch(applyDamage(state, value - 1))
{
case EWallState::INTACT : return EWallState::DAMAGED;
case EWallState::DAMAGED : return EWallState::DESTROYED;
case EWallState::DESTROYED : return EWallState::DESTROYED;
default: return EWallState::NONE;
case EWallState::INTACT:
return EWallState::DAMAGED;
case EWallState::DAMAGED:
return EWallState::DESTROYED;
case EWallState::DESTROYED:
return EWallState::DESTROYED;
default:
return EWallState::NONE;
}
}

View File

@ -8,7 +8,7 @@
*
*/
#pragma once
#include "GameConstants.h"
#include "../GameConstants.h"
//only for use in BattleInfo
struct DLL_LINKAGE SiegeInfo