-Fix for issue 583 (fireball crash)

-- converted an array into a vector to avoid weird edge cases
-- fixed bugs with array "backupTargets"
This commit is contained in:
wagic.the.homebrew
2011-05-26 12:27:44 +00:00
parent ffda1d0548
commit a84eb8dc22
10 changed files with 96 additions and 72 deletions

View File

@@ -1,43 +1,43 @@
#ifndef _AIHINTS_H_
#define _AIHINTS_H_
#ifndef _AIHINTS_H_
#define _AIHINTS_H_
#include <string>
#include <vector>
using std::string;
using std::vector;
#include "AIPlayer.h"
class ManaCost;
class MTGAbility;
class AIHint
{
public:
string mCondition;
string mAction;
int mSourceId;
AIHint(string line);
};
class AIHints
{
protected:
AIPlayer * mPlayer;
vector<AIHint *> hints;
AIHint * getByCondition (string condition);
AIAction * findAbilityRecursive(AIHint * hint, ManaCost * potentialMana);
vector<MTGAbility *> findAbilities(AIHint * hint);
RankingContainer findActions(AIHint * hint);
string constraintsNotFulfilled(AIAction * a, AIHint * hint, ManaCost * potentialMana);
bool findSource(int sourceId);
bool abilityMatches(MTGAbility * a, AIHint * hint);
public:
AIHints (AIPlayer * player);
AIAction * suggestAbility(ManaCost * potentialMana);
void add(string line);
~AIHints();
};
using std::string;
using std::vector;
#include "AIPlayer.h"
class ManaCost;
class MTGAbility;
class AIHint
{
public:
string mCondition;
string mAction;
int mSourceId;
AIHint(string line);
};
class AIHints
{
protected:
AIPlayer * mPlayer;
vector<AIHint *> hints;
AIHint * getByCondition (string condition);
AIAction * findAbilityRecursive(AIHint * hint, ManaCost * potentialMana);
vector<MTGAbility *> findAbilities(AIHint * hint);
RankingContainer findActions(AIHint * hint);
string constraintsNotFulfilled(AIAction * a, AIHint * hint, ManaCost * potentialMana);
bool findSource(int sourceId);
bool abilityMatches(MTGAbility * a, AIHint * hint);
public:
AIHints (AIPlayer * player);
AIAction * suggestAbility(ManaCost * potentialMana);
void add(string line);
~AIHints();
};
#endif