AIPlayer minor tweaks:

- In order to clarify getEfficiency, started creating "getEfficiency" functions specific to each type of ability (see example with Damager). This won't reduce the file size but should make things bit clearer
- Minor cleanup of getEfficiency
- bug fixes in getEfficiency
This commit is contained in:
wagic.the.homebrew
2011-09-21 15:10:06 +00:00
parent 11095f3339
commit 15f0143a8f
10 changed files with 413 additions and 2489 deletions

View File

@@ -2,6 +2,7 @@
#define _AI_PLAYER_BAKA_H_
#include "AIPlayer.h"
#include "AllAbilities.h"
class AIStats;
class AIHints;
@@ -12,33 +13,37 @@ class AIHints;
class OrderedAIAction: public AIAction
{
protected:
Player * getPlayerTarget();
public:
int efficiency;
OrderedAIAction(MTGAbility * a, MTGCardInstance * c, MTGCardInstance * t = NULL)
: AIAction(a, c, t), efficiency(-1)
OrderedAIAction(Player * owner, MTGAbility * a, MTGCardInstance * c, MTGCardInstance * t = NULL)
: AIAction(owner, a, c, t), efficiency(-1)
{
};
OrderedAIAction(MTGCardInstance * c, MTGCardInstance * t = NULL);
OrderedAIAction(Player * owner, MTGCardInstance * c, MTGCardInstance * t = NULL);
OrderedAIAction(Player * p)//player targeting through spells
: AIAction(p), efficiency(-1)
OrderedAIAction(Player * owner, Player * p)//player targeting through spells
: AIAction(owner,p), efficiency(-1)
{
};
OrderedAIAction(MTGAbility * a, MTGCardInstance * c, vector<Targetable*>targetCards)
: AIAction(a, c, targetCards), efficiency(-1)
OrderedAIAction(Player * owner, MTGAbility * a, MTGCardInstance * c, vector<Targetable*>targetCards)
: AIAction(owner,a, c, targetCards), efficiency(-1)
{
};
OrderedAIAction(MTGAbility * a, Player * p, MTGCardInstance * c)//player targeting through abilities.
: AIAction(a, p, c), efficiency(-1)
OrderedAIAction(Player * owner, MTGAbility * a, Player * p, MTGCardInstance * c)//player targeting through abilities.
: AIAction(owner, a, p, c), efficiency(-1)
{
};
int getEfficiency();
// Functions depending on the type of Ability
int getEfficiency(AADamager * aad);
};
// compares Abilities efficiency
@@ -60,7 +65,7 @@ typedef std::map<OrderedAIAction, int, CmpAbilities> RankingContainer;
class AIPlayerBaka: public AIPlayer{
private:
protected:
virtual int orderBlockers();
virtual int combatDamages();
virtual int interruptIfICan();
@@ -84,7 +89,6 @@ private:
virtual AIStats * getStats();
protected:
MTGCardInstance * nextCardToPlay;
AIHints * hints;
AIStats * stats;