Files
wagic/projects/mtg/src/Token.cpp
T
Xawotihs 9adb9d625d - reworked the testsuite and the rules (storyflow) to use the same game deserialization code, moved that code to the players and zone classes
- removed every references to the gameobserver singleton. This object can now be instantiated several times as it's needed for minmax. To be able to do that, I mostly added a reference to a gameobserver from any targetable object (cards, players, spells) and abilities.
2011-10-01 13:30:30 +00:00

37 lines
902 B
C++

#include "PrecompiledHeader.h"
#include "Token.h"
Token::Token(string _name, MTGCardInstance * source, int _power, int _toughness) :
MTGCardInstance()
{
isToken = true;
tokenSource = source;
power = _power;
toughness = _toughness;
life = toughness;
lifeOrig = life;
origpower = _power;
origtoughness = _toughness;
rarity = Constants::RARITY_T;
name = _name;
if (name.size() && name[0] >= 97 && name[0] <= 122) name[0] -= 32; //Poor man's camelcase. We assume strings we get are either Camelcased or lowercase
setMTGId(-source->getMTGId());
setId = source->setId;
model = this;
data = this;
owner = source->owner;
belongs_to = source->controller()->game;
attacker = 0;
defenser = NULL;
banding = NULL;
}
Token::Token(int id) :
MTGCardInstance()
{
isToken = true;
name = "dummyToken";
setMTGId(id);
}