2009-05-10 11:15:30 +03:00
|
|
|
#ifndef __BATTLE_HELPER__
|
|
|
|
#define __BATTLE_HELPER__
|
|
|
|
|
|
|
|
#include "Common.h"
|
|
|
|
|
2009-10-23 01:04:42 +03:00
|
|
|
namespace geniusai { namespace BattleAI {
|
2009-05-10 11:15:30 +03:00
|
|
|
|
|
|
|
class CBattleHelper
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CBattleHelper();
|
|
|
|
~CBattleHelper();
|
|
|
|
|
|
|
|
int GetBattleFieldPosition(int x, int y);
|
|
|
|
int DecodeXPosition(int battleFieldPosition);
|
|
|
|
int DecodeYPosition(int battleFieldPosition);
|
|
|
|
|
2011-06-09 16:23:38 +03:00
|
|
|
int StepDownright(int pos);
|
|
|
|
int StepUpright(int pos);
|
|
|
|
int StepDownleft(int pos);
|
|
|
|
int StepUpleft(int pos);
|
|
|
|
int StepRight(int pos);
|
|
|
|
int StepLeft(int pos);
|
|
|
|
|
2009-05-10 11:15:30 +03:00
|
|
|
int GetShortestDistance(int pointA, int pointB);
|
|
|
|
int GetDistanceWithObstacles(int pointA, int pointB);
|
|
|
|
|
|
|
|
int GetVoteForMaxDamage() const { return m_voteForMaxDamage; }
|
|
|
|
int GetVoteForMinDamage() const { return m_voteForMinDamage; }
|
|
|
|
int GetVoteForMaxSpeed() const { return m_voteForMaxSpeed; }
|
|
|
|
int GetVoteForDistance() const { return m_voteForDistance; }
|
|
|
|
int GetVoteForDistanceFromShooters() const { return m_voteForDistanceFromShooters; }
|
|
|
|
int GetVoteForHitPoints() const { return m_voteForHitPoints; }
|
|
|
|
|
|
|
|
const int InfiniteDistance;
|
|
|
|
const int BattlefieldWidth;
|
|
|
|
const int BattlefieldHeight;
|
|
|
|
private:
|
|
|
|
int m_voteForMaxDamage;
|
|
|
|
int m_voteForMinDamage;
|
|
|
|
int m_voteForMaxSpeed;
|
|
|
|
int m_voteForDistance;
|
|
|
|
int m_voteForDistanceFromShooters;
|
|
|
|
int m_voteForHitPoints;
|
|
|
|
|
|
|
|
CBattleHelper(const CBattleHelper &);
|
|
|
|
CBattleHelper &operator=(const CBattleHelper &);
|
|
|
|
};
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
#endif/*__BATTLE_HELPER__*/
|