-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:
@@ -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
|
||||
Reference in New Issue
Block a user