2016-10-28 16:16:46 +02:00
|
|
|
/*
|
|
|
|
* AttackPossibility.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
|
2017-07-20 06:08:49 +02:00
|
|
|
#include "../../lib/battle/CUnitState.h"
|
2016-11-01 20:53:46 +02:00
|
|
|
#include "../../CCallback.h"
|
2016-10-28 16:16:46 +02:00
|
|
|
#include "common.h"
|
2017-07-20 06:08:49 +02:00
|
|
|
#include "StackWithBonuses.h"
|
2016-10-28 16:16:46 +02:00
|
|
|
|
|
|
|
class AttackPossibility
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BattleHex tile; //tile from which we attack
|
|
|
|
BattleAttackInfo attack;
|
|
|
|
|
2017-07-20 06:08:49 +02:00
|
|
|
std::shared_ptr<battle::CUnitState> attackerState;
|
|
|
|
|
|
|
|
std::vector<std::shared_ptr<battle::CUnitState>> affectedUnits;
|
|
|
|
|
|
|
|
int64_t damageDealt = 0;
|
|
|
|
int64_t damageReceived = 0; //usually by counter-attack
|
|
|
|
int64_t tacticImpact = 0;
|
|
|
|
|
|
|
|
AttackPossibility(BattleHex tile_, const BattleAttackInfo & attack_);
|
2016-10-28 16:16:46 +02:00
|
|
|
|
2017-07-20 06:08:49 +02:00
|
|
|
int64_t damageDiff() const;
|
|
|
|
int64_t attackValue() const;
|
2016-10-28 16:16:46 +02:00
|
|
|
|
2017-07-20 06:08:49 +02:00
|
|
|
static AttackPossibility evaluate(const BattleAttackInfo & attackInfo, BattleHex hex);
|
2016-10-28 16:16:46 +02:00
|
|
|
};
|