Files
wagic/projects/mtg/include/TargetsList.h
Xawotihs 29132073de - Modified DeckManager class to not use a global instance anymore when used within the game engine
- Modified DuelLayers to not use a global MTGPhaseGame instance anymore
- Moved the reset of currentActionCard out of the ActionLayer render function : that fixes the remaing problematic tests in the multithreaded testsuite
- Added a method in ActionLayer converting a card ability into a menu index
- Used this new method in the game observer to log correctly AI ability actions
- Added a DumpAssert method in the game observer, it can be used to dump the game and assert in order to easy crash reproduction
- Cleaned up TargetList properties access
- Added an optimisation in GuiMana to not compute update code if the rendering is not used (multi-threaded mode)
- Added a deadlock detection in the test AI vs AI multithreaded mode
- Fixed minor bugs in test AI vs AI multithreaded mode
- Added a games/second counter in the test AI vs AI rendering
2011-11-23 19:11:48 +00:00

43 lines
1.1 KiB
C++

#ifndef _TARGETSLIST_H_
#define _TARGETSLIST_H_
class Targetable;
class MTGCardInstance;
class Player;
class Damageable;
class Spell;
class Interruptible;
class Damage;
#include <vector>
using std::vector;
class TargetsList
{
protected:
size_t iterateTarget(Targetable * previous);
vector<Targetable*> targets;
public:
TargetsList();
TargetsList(Targetable * _targets[], int nbtargets);
int alreadyHasTarget(Targetable * target);
int removeTarget(Targetable * _card);
int toggleTarget(Targetable * _card);
size_t getNbTargets() {return targets.size();};
virtual int addTarget(Targetable * _target);
MTGCardInstance * getNextCardTarget(MTGCardInstance * previous = 0);
Player * getNextPlayerTarget(Player * previous = 0);
Damageable * getNextDamageableTarget(Damageable * previous = 0);
Interruptible * getNextInterruptible(Interruptible * previous, int type);
Spell * getNextSpellTarget(Spell * previous = 0);
Damage * getNextDamageTarget(Damage * previous = 0);
Targetable * getNextTarget(Targetable * previous = 0);
void initTargets()
{
targets.clear();
}
;
};
#endif