- some dangerous casts Player/MTGCardInstance fixed

- removed typeAsTarget function and replaced with dynamic casting
- The test suite passes, but it is possible that I busted some of AI's features :(
This commit is contained in:
wagic.the.homebrew
2011-11-19 14:07:57 +00:00
parent e9139bedab
commit 851e1f20f1
16 changed files with 237 additions and 317 deletions

View File

@@ -1,17 +1,12 @@
#ifndef _TARGETABLE_H_
#define _TARGETABLE_H_
#define TARGET_CARD 1
#define TARGET_PLAYER 2
#define TARGET_STACKACTION 3
class Targetable
{
protected:
GameObserver* observer;
public:
Targetable(GameObserver* observer) : observer(observer) {};
virtual int typeAsTarget() = 0;
virtual const string getDisplayName() const = 0;
inline GameObserver* getObserver() { return observer; };
virtual void setObserver(GameObserver*g) { observer = g; };