* ostream printing of JGui objects.
This commit is contained in:
jean.chalard
2009-05-23 08:34:50 +00:00
parent 215e23a975
commit dd054c4963
32 changed files with 1505 additions and 528 deletions

View File

@@ -62,6 +62,7 @@ class NextGamePhase: public Interruptible {
public: public:
int resolve(); int resolve();
void Render(); void Render();
virtual ostream& toString(ostream& out) const;
NextGamePhase(int id); NextGamePhase(int id);
}; };
@@ -75,6 +76,7 @@ class Spell: public Interruptible, public TargetsList {
~Spell(); ~Spell();
int resolve(); int resolve();
void Render(); void Render();
virtual ostream& toString(ostream& out) const;
}; };
class StackAbility: public Interruptible { class StackAbility: public Interruptible {
@@ -82,6 +84,7 @@ class StackAbility: public Interruptible {
MTGAbility * ability; MTGAbility * ability;
int resolve(); int resolve();
void Render(); void Render();
virtual ostream& toString(ostream& out) const;
StackAbility(int id, MTGAbility * _ability); StackAbility(int id, MTGAbility * _ability);
}; };
@@ -91,6 +94,7 @@ class PutInGraveyard: public Interruptible {
int removeFromGame; int removeFromGame;
int resolve(); int resolve();
void Render(); void Render();
virtual ostream& toString(ostream& out) const;
PutInGraveyard(int id, MTGCardInstance * _card); PutInGraveyard(int id, MTGCardInstance * _card);
}; };
@@ -101,6 +105,7 @@ class DrawAction: public Interruptible {
Player * player; Player * player;
int resolve(); int resolve();
void Render(); void Render();
virtual ostream& toString(ostream& out) const;
DrawAction(int id, Player * _player, int _nbcards); DrawAction(int id, Player * _player, int _nbcards);
}; };

File diff suppressed because it is too large Load Diff

View File

@@ -20,6 +20,7 @@ class CardDisplay:public PlayGuiObjectController{
bool CheckUserInput(u32 key); bool CheckUserInput(u32 key);
void Render(); void Render();
void init(MTGGameZone * zone); void init(MTGGameZone * zone);
virtual ostream& toString(ostream& out) const;
}; };
@@ -29,4 +30,7 @@ class DefaultTargetDisplay:CardDisplay{
DefaultTargetDisplay(int id, GameObserver* _game, int _x, int _y, JGuiListener * _listener, int _nb_displayed_items ); DefaultTargetDisplay(int id, GameObserver* _game, int _x, int _y, JGuiListener * _listener, int _nb_displayed_items );
~DefaultTargetDisplay(); ~DefaultTargetDisplay();
}; };
std::ostream& operator<<(std::ostream& out, const CardDisplay& m);
#endif #endif

View File

@@ -20,6 +20,7 @@ class CardGui: public PlayGuiObject{
CardGui(int id, MTGCardInstance * _card, float desiredHeight, float _x=0, float _y=0, bool hasFocus = false); CardGui(int id, MTGCardInstance * _card, float desiredHeight, float _x=0, float _y=0, bool hasFocus = false);
virtual void Render(); virtual void Render();
virtual void Update(float dt); virtual void Update(float dt);
virtual ostream& toString(ostream& out) const;
void RenderBig(float x=-1, float y = -1, int alternate = 0); void RenderBig(float x=-1, float y = -1, int alternate = 0);
static void alternateRender(MTGCard * card, JQuad ** manaIcons, float x, float y, float rotation= 0, float scale=1); static void alternateRender(MTGCard * card, JQuad ** manaIcons, float x, float y, float rotation= 0, float scale=1);

View File

@@ -36,6 +36,7 @@ class Damage: public Interruptible {
Damage(int id, MTGCardInstance* _source, Damageable * _target); Damage(int id, MTGCardInstance* _source, Damageable * _target);
Damage(int id, MTGCardInstance* _source, Damageable * _target, int _damage); Damage(int id, MTGCardInstance* _source, Damageable * _target, int _damage);
int resolve(); int resolve();
virtual ostream& toString(ostream& out) const;
}; };
@@ -49,6 +50,7 @@ class DamageStack :public GuiLayer, public Interruptible{
void Render(); void Render();
int CombatDamages();//Deprecated ? int CombatDamages();//Deprecated ?
int CombatDamages(int strike); int CombatDamages(int strike);
virtual ostream& toString(ostream& out) const;
DamageStack(int id, GameObserver* _game); DamageStack(int id, GameObserver* _game);
}; };

View File

@@ -54,6 +54,7 @@ class GameStateMenu: public GameState, public JGuiListener
int nextCardSet(); // Retrieves the next set subfolder automatically int nextCardSet(); // Retrieves the next set subfolder automatically
void createUsersFirstDeck(int setId); void createUsersFirstDeck(int setId);
virtual ostream& toString(ostream& out) const;
}; };
#endif #endif

View File

@@ -25,8 +25,8 @@ using std::map;
//Two stupid variables used to give a hint to the AI: //Two stupid variables used to give a hint to the AI:
// Should I cast a spell on an enemy or friendly unit ? // Should I cast a spell on an enemy or friendly unit ?
#define BAKA_EFFECT_GOOD 1 #define BAKA_EFFECT_GOOD 1
#define BAKA_EFFECT_BAD -1 #define BAKA_EFFECT_BAD -1
#define BAKA_EFFECT_DONTKNOW 0 #define BAKA_EFFECT_DONTKNOW 0
#define COUNT_POWER 1 #define COUNT_POWER 1
@@ -38,7 +38,7 @@ using std::map;
class MTGAbility: public ActionElement{ class MTGAbility: public ActionElement{
protected: protected:
char menuText[25]; char menuText[25];
GameObserver * game; GameObserver * game;
public: public:
int forceDestroy; int forceDestroy;
@@ -58,6 +58,7 @@ class MTGAbility: public ActionElement{
virtual int fireAbility(); virtual int fireAbility();
virtual int stillInUse(MTGCardInstance * card){if (card==source) return 1; return 0;}; virtual int stillInUse(MTGCardInstance * card){if (card==source) return 1; return 0;};
virtual int resolve(){return 0;}; virtual int resolve(){return 0;};
virtual ostream& toString(ostream& out) const;
/*Poor man's casting */ /*Poor man's casting */
/* Todo replace that crap with dynamic casting */ /* Todo replace that crap with dynamic casting */
@@ -70,7 +71,6 @@ class MTGAbility: public ActionElement{
PUT_INTO_PLAY = 5, PUT_INTO_PLAY = 5,
MOMIR = 6, MOMIR = 6,
MTG_BLOCK_RULE = 7, MTG_BLOCK_RULE = 7,
}; };
}; };
@@ -83,6 +83,7 @@ class TriggeredAbility:public MTGAbility{
virtual void Render(){}; virtual void Render(){};
virtual int trigger()=0; virtual int trigger()=0;
virtual int resolve() = 0; virtual int resolve() = 0;
virtual ostream& toString(ostream& out) const;
}; };
@@ -95,6 +96,7 @@ class ActivatedAbility:public MTGAbility{
virtual int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL); virtual int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
virtual int reactToTargetClick(Targetable * object); virtual int reactToTargetClick(Targetable * object);
virtual int resolve() = 0; virtual int resolve() = 0;
virtual ostream& toString(ostream& out) const;
}; };
class TargetAbility:public ActivatedAbility{ class TargetAbility:public ActivatedAbility{
@@ -105,6 +107,7 @@ class TargetAbility:public ActivatedAbility{
virtual int reactToClick(MTGCardInstance * card); virtual int reactToClick(MTGCardInstance * card);
virtual int reactToTargetClick(Targetable * object); virtual int reactToTargetClick(Targetable * object);
virtual void Render(); virtual void Render();
virtual ostream& toString(ostream& out) const;
}; };
class InstantAbility:public MTGAbility{ class InstantAbility:public MTGAbility{
@@ -115,6 +118,7 @@ class InstantAbility:public MTGAbility{
InstantAbility(int _id, MTGCardInstance * source); InstantAbility(int _id, MTGCardInstance * source);
InstantAbility(int _id, MTGCardInstance * source,Damageable * _target); InstantAbility(int _id, MTGCardInstance * source,Damageable * _target);
virtual int resolve(){return 0;}; virtual int resolve(){return 0;};
virtual ostream& toString(ostream& out) const;
}; };
/* State based effects. This class works ONLY for InPlay and needs to be extended for other areas of the game !!! */ /* State based effects. This class works ONLY for InPlay and needs to be extended for other areas of the game !!! */
@@ -129,6 +133,7 @@ class ListMaintainerAbility:public MTGAbility{
virtual int added(MTGCardInstance * card) = 0; virtual int added(MTGCardInstance * card) = 0;
virtual int removed(MTGCardInstance * card) = 0; virtual int removed(MTGCardInstance * card) = 0;
virtual int destroy(); virtual int destroy();
virtual ostream& toString(ostream& out) const;
}; };
/* An attempt to globalize triggered abilities as much as possible */ /* An attempt to globalize triggered abilities as much as possible */
@@ -234,7 +239,7 @@ class AbilityFactory{
class AManaProducer: public MTGAbility{ class AManaProducer: public MTGAbility{
protected: protected:
ManaCost * cost; ManaCost * cost;
ManaCost * output; ManaCost * output;
string menutext; string menutext;
@@ -255,9 +260,10 @@ class AManaProducer: public MTGAbility{
const char * getMenuText(); const char * getMenuText();
int testDestroy(); int testDestroy();
~AManaProducer(); ~AManaProducer();
virtual ostream& toString(ostream& out) const;
}; };
#include "MTGCardInstance.h" #include "MTGCardInstance.h"
#endif #endif

View File

@@ -18,6 +18,7 @@ class MTGGamePhase: public ActionElement {
virtual void Render(); virtual void Render();
virtual void Update(float dt); virtual void Update(float dt);
bool CheckUserInput(u32 key); bool CheckUserInput(u32 key);
virtual ostream& toString(ostream& out) const;
}; };

View File

@@ -13,9 +13,9 @@ class MTGPutInPlayRule:public MTGAbility{
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL); int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
int reactToClick(MTGCardInstance * card); int reactToClick(MTGCardInstance * card);
int testDestroy(); int testDestroy();
virtual ostream& toString(ostream& out) const;
MTGPutInPlayRule(int _id); MTGPutInPlayRule(int _id);
const char * getMenuText(){return "Put into play";} const char * getMenuText(){return "Put into play";}
}; };
class MTGAttackRule:public MTGAbility{ class MTGAttackRule:public MTGAbility{
@@ -23,10 +23,10 @@ class MTGAttackRule:public MTGAbility{
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL); int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
int reactToClick(MTGCardInstance * card); int reactToClick(MTGCardInstance * card);
int testDestroy(); int testDestroy();
virtual ostream& toString(ostream& out) const;
MTGAttackRule(int _id); MTGAttackRule(int _id);
const char * getMenuText(){return "Attacker";} const char * getMenuText(){return "Attacker";}
void Update(float dt); void Update(float dt);
}; };
class MTGBlockRule:public MTGAbility{ class MTGBlockRule:public MTGAbility{
@@ -34,6 +34,7 @@ class MTGBlockRule:public MTGAbility{
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL); int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
int reactToClick(MTGCardInstance * card); int reactToClick(MTGCardInstance * card);
int testDestroy(); int testDestroy();
virtual ostream& toString(ostream& out) const;
MTGBlockRule(int _id); MTGBlockRule(int _id);
const char * getMenuText(){return "Blocker";} const char * getMenuText(){return "Blocker";}
}; };
@@ -78,8 +79,12 @@ OutputDebugString("Receive5\n");
return 0; return 0;
} }
virtual ostream& toString(ostream& out) const
{
out << "MTGPersistRule ::: (";
return MTGAbility::toString(out) << ")";
}
int testDestroy(){return 0;} int testDestroy(){return 0;}
}; };
@@ -119,6 +124,11 @@ class MTGLegendRule:public ListMaintainerAbility{
int removed(MTGCardInstance * card){return 0;} int removed(MTGCardInstance * card){return 0;}
int testDestroy(){return 0;} int testDestroy(){return 0;}
virtual ostream& toString(ostream& out) const
{
return out << "MTGLegendRule :::";
}
}; };
@@ -143,6 +153,7 @@ public:
int reactToClick(MTGCardInstance * card); int reactToClick(MTGCardInstance * card);
int reactToClick(MTGCardInstance * card, int id); int reactToClick(MTGCardInstance * card, int id);
const char * getMenuText(){return "Momir";} const char * getMenuText(){return "Momir";}
virtual ostream& toString(ostream& out) const;
}; };
@@ -166,6 +177,11 @@ class MTGLifelinkRule:public MTGAbility{
int testDestroy(){return 0;} int testDestroy(){return 0;}
virtual ostream& toString(ostream& out) const
{
out << "MTGLifelinkRule ::: (";
return MTGAbility::toString(out) << ")";
}
}; };

View File

@@ -64,4 +64,6 @@ class ManaCost{
#endif #endif
}; };
std::ostream& operator<<(std::ostream& out, const ManaCost& m);
#endif #endif

View File

@@ -39,6 +39,8 @@ class MenuItem: public JGuiObject
virtual void Entering(); virtual void Entering();
virtual bool Leaving(u32 key); virtual bool Leaving(u32 key);
virtual bool ButtonPressed(); virtual bool ButtonPressed();
virtual ostream& toString(ostream& out) const;
}; };
#endif #endif

View File

@@ -22,6 +22,7 @@ class OptionItem:public JGuiObject{
virtual bool Leaving(); virtual bool Leaving();
void setData(); void setData();
virtual void updateValue(){value+=increment; if (value>maxValue) value=0;}; virtual void updateValue(){value+=increment; if (value>maxValue) value=0;};
virtual ostream& toString(ostream& out) const;
}; };
class OptionsList{ class OptionsList{

View File

@@ -47,6 +47,7 @@ class GuiAvatar: public PlayGuiObject{
Player * player; Player * player;
virtual void Render(); virtual void Render();
GuiAvatar(int id, float desiredHeight,float _x, float _y, bool hasFocus,Player * _player); GuiAvatar(int id, float desiredHeight,float _x, float _y, bool hasFocus,Player * _player);
virtual ostream& toString(ostream& out) const;
}; };
class GuiGameZone: public PlayGuiObject{ class GuiGameZone: public PlayGuiObject{
@@ -62,16 +63,19 @@ class GuiGameZone: public PlayGuiObject{
~GuiGameZone(); ~GuiGameZone();
virtual void ButtonPressed(int controllerId, int controlId); virtual void ButtonPressed(int controllerId, int controlId);
void toggleDisplay(); void toggleDisplay();
virtual ostream& toString(ostream& out) const;
}; };
class GuiGraveyard: public GuiGameZone{ class GuiGraveyard: public GuiGameZone{
public: public:
GuiGraveyard(int id, float desiredHeight,float _x, float _y, bool hasFocus,Player * player); GuiGraveyard(int id, float desiredHeight,float _x, float _y, bool hasFocus,Player * player);
virtual ostream& toString(ostream& out) const;
}; };
class GuiLibrary: public GuiGameZone{ class GuiLibrary: public GuiGameZone{
public: public:
GuiLibrary(int id, float desiredHeight,float _x, float _y, bool hasFocus,Player * player); GuiLibrary(int id, float desiredHeight,float _x, float _y, bool hasFocus,Player * player);
virtual ostream& toString(ostream& out) const;
}; };

View File

@@ -46,6 +46,7 @@ class ShopItem:public JGuiObject{
virtual bool ButtonPressed(); virtual bool ButtonPressed();
const char * getText(); const char * getText();
virtual ostream& toString(ostream& out) const;
}; };
class ShopItems:public JGuiController,public JGuiListener{ class ShopItems:public JGuiController,public JGuiListener{

View File

@@ -40,6 +40,7 @@ class SimpleMenuItem: public JGuiObject
virtual void Entering(); virtual void Entering();
virtual bool Leaving(u32 key); virtual bool Leaving(u32 key);
virtual bool ButtonPressed(); virtual bool ButtonPressed();
virtual ostream& toString(ostream& out) const;
}; };
#endif #endif

View File

@@ -19,7 +19,7 @@ private:
float start; float start;
int timer; int timer;
vector<string> strings; vector<string> strings;
int currentId; unsigned int currentId;
int mRandom; int mRandom;
public: public:
void Add(string text); void Add(string text);
@@ -28,6 +28,7 @@ public:
TextScroller(JLBFont * font, float x, float y, float width, float speed = 30); TextScroller(JLBFont * font, float x, float y, float width, float speed = 30);
void Render(); void Render();
void Update(float dt); void Update(float dt);
virtual ostream& toString(ostream& out) const;
}; };
#endif #endif

View File

@@ -7,8 +7,8 @@
#include "../include/GameObserver.h" #include "../include/GameObserver.h"
#include "../include/Damage.h" #include "../include/Damage.h"
#include "../include/ManaCost.h" #include "../include/ManaCost.h"
#include "../include/GameOptions.h" #include "../include/GameOptions.h"
// WALDORF - added to support drawing big cards during interrupts // WALDORF - added to support drawing big cards during interrupts
#include "../include/CardGui.h" #include "../include/CardGui.h"
#include "../include/Translate.h" #include "../include/Translate.h"
@@ -38,6 +38,11 @@ NextGamePhase::NextGamePhase(int id): Interruptible(id){
type = ACTION_NEXTGAMEPHASE; type = ACTION_NEXTGAMEPHASE;
} }
ostream& NextGamePhase::toString(ostream& out) const
{
out << "NextGamePhase ::: ";
return out;
}
/* Ability */ /* Ability */
int StackAbility::resolve(){ int StackAbility::resolve(){
@@ -64,6 +69,11 @@ StackAbility::StackAbility(int id,MTGAbility * _ability): Interruptible(id),abil
type=ACTION_ABILITY; type=ACTION_ABILITY;
} }
ostream& StackAbility::toString(ostream& out) const
{
out << "StackAbility ::: ability : " << ability;
return out;
}
/* Spell Cast */ /* Spell Cast */
@@ -121,36 +131,36 @@ void Spell::Render(){
}else{ }else{
// //
} }
// WALDORF - added these lines to render a big card as well as the small one // WALDORF - added these lines to render a big card as well as the small one
// in the interrupt window. A big card will be rendered no matter whether // in the interrupt window. A big card will be rendered no matter whether
// the user has been using big cards or not. However, I do take into which // the user has been using big cards or not. However, I do take into which
// kind of big card they like. // kind of big card they like.
// The card will be rendered in the same place as the GuiHand // The card will be rendered in the same place as the GuiHand
// card. It doesn't attempt to hide the GUIHand card, it // card. It doesn't attempt to hide the GUIHand card, it
// just overwrites it. // just overwrites it.
// I stole the render code from RenderBig() in CardGUI.cpp // I stole the render code from RenderBig() in CardGUI.cpp
quad = source->getQuad(); quad = source->getQuad();
if (quad){ if (quad){
quad->SetColor(ARGB(220,255,255,255)); quad->SetColor(ARGB(220,255,255,255));
float scale = 257.f / quad->mHeight; float scale = 257.f / quad->mHeight;
renderer->RenderQuad(quad, 10 , 20 , 0.0f,scale,scale); renderer->RenderQuad(quad, 10 , 20 , 0.0f,scale,scale);
} }
else else
{ {
MTGCard * mtgcard = source->model; MTGCard * mtgcard = source->model;
JLBFont * font = GameApp::CommonRes->GetJLBFont("graphics/magic"); JLBFont * font = GameApp::CommonRes->GetJLBFont("graphics/magic");
CardGui::alternateRender(mtgcard, NULL, 10 + 90 , 20 + 130, 0.0f,0.9f); CardGui::alternateRender(mtgcard, NULL, 10 + 90 , 20 + 130, 0.0f,0.9f);
quad = source->getThumb(); quad = source->getThumb();
if (quad){ if (quad){
float scale = 250 / quad->mHeight; float scale = 250 / quad->mHeight;
quad->SetColor(ARGB(40,255,255,255)); quad->SetColor(ARGB(40,255,255,255));
renderer->RenderQuad(quad, 20, 20, 0.0f, scale, scale); renderer->RenderQuad(quad, 20, 20, 0.0f, scale, scale);
} }
} }
// WALDORF - end // WALDORF - end
Damageable * target = getNextDamageableTarget(); Damageable * target = getNextDamageableTarget();
@@ -167,6 +177,12 @@ void Spell::Render(){
} }
} }
ostream& Spell::toString(ostream& out) const
{
out << "Spell ::: cost : " << cost;
return out;
}
/* Put a card in graveyard */ /* Put a card in graveyard */
@@ -206,6 +222,11 @@ void PutInGraveyard::Render(){
} }
} }
ostream& PutInGraveyard::toString(ostream& out) const
{
out << "PutInGraveyard ::: removeFromGame : " << removeFromGame;
return out;
}
/* Draw a Card */ /* Draw a Card */
DrawAction::DrawAction(int id, Player * _player, int _nbcards):Interruptible(id), nbcards(_nbcards), player(_player){ DrawAction::DrawAction(int id, Player * _player, int _nbcards):Interruptible(id), nbcards(_nbcards), player(_player){
@@ -229,6 +250,12 @@ void DrawAction::Render(){
mFont->DrawString(buffer, x + 20 , y, JGETEXT_LEFT); mFont->DrawString(buffer, x + 20 , y, JGETEXT_LEFT);
} }
ostream& DrawAction::toString(ostream& out) const
{
out << "DrawAction ::: nbcards : " << nbcards << " ; player : " << player;
return out;
}
/* The Action Stack itself */ /* The Action Stack itself */
int ActionStack::addPutInGraveyard(MTGCardInstance * card){ int ActionStack::addPutInGraveyard(MTGCardInstance * card){
PutInGraveyard * death = NEW PutInGraveyard(mCount,card); PutInGraveyard * death = NEW PutInGraveyard(mCount,card);
@@ -445,11 +472,11 @@ void ActionStack::unpackDamageStacks(){
} }
void ActionStack::repackDamageStacks(){ void ActionStack::repackDamageStacks(){
std::vector<JGuiObject *>::iterator iter = mObjects.begin() ; std::vector<JGuiObject *>::iterator iter = mObjects.begin() ;
while( iter != mObjects.end() ){ while( iter != mObjects.end() ){
Interruptible * action = ((Interruptible *) *iter); Interruptible * action = ((Interruptible *) *iter);
int found = 0; int found = 0;
if (action->type == ACTION_DAMAGE){ if (action->type == ACTION_DAMAGE){
Damage * damage = (Damage *) action; Damage * damage = (Damage *) action;
for (int j = 0; j < mCount; j++){ for (int j = 0; j < mCount; j++){
@@ -467,8 +494,8 @@ void ActionStack::repackDamageStacks(){
} }
} }
} }
} }
if (!found) ++iter; if (!found) ++iter;
} }
/* /*
@@ -562,13 +589,13 @@ void ActionStack::Update(float dt){
GuiLayer::Update(dt); GuiLayer::Update(dt);
} }
if (askIfWishesToInterrupt){ if (askIfWishesToInterrupt){
// WALDORF - added code to use a game option setting to determine how // WALDORF - added code to use a game option setting to determine how
// long the Interrupt timer should be. If it is set to zero (0), the // long the Interrupt timer should be. If it is set to zero (0), the
// game will wait for ever for the user to make a selection. // game will wait for ever for the user to make a selection.
if (GameOptions::GetInstance()->values[OPTIONS_INTERRUPT_SECONDS].getIntValue() > 0) if (GameOptions::GetInstance()->values[OPTIONS_INTERRUPT_SECONDS].getIntValue() > 0)
{ {
if (timer < 0) timer = GameOptions::GetInstance()->values[OPTIONS_INTERRUPT_SECONDS].getIntValue(); if (timer < 0) timer = GameOptions::GetInstance()->values[OPTIONS_INTERRUPT_SECONDS].getIntValue();
timer -= dt; timer -= dt;
if (timer < 0) cancelInterruptOffer(); if (timer < 0) cancelInterruptOffer();
} }
} }
@@ -686,17 +713,17 @@ int ActionStack::CombatDamages(int strike){
//Cleans history of last turn //Cleans history of last turn
int ActionStack::garbageCollect(){ int ActionStack::garbageCollect(){
std::vector<JGuiObject *>::iterator iter = mObjects.begin() ; std::vector<JGuiObject *>::iterator iter = mObjects.begin() ;
while( iter != mObjects.end() ){ while( iter != mObjects.end() ){
Interruptible * current = ((Interruptible *) *iter); Interruptible * current = ((Interruptible *) *iter);
if (current->state != NOT_RESOLVED){ if (current->state != NOT_RESOLVED){
iter = mObjects.erase( iter ) ; iter = mObjects.erase( iter ) ;
mCount--; mCount--;
SAFE_DELETE(current); SAFE_DELETE(current);
}else { }else {
++iter ; ++iter ;
} }
} }
return 1; return 1;
} }
@@ -756,26 +783,26 @@ void ActionStack::Render(){
} }
char buffer[200]; char buffer[200];
// WALDORF - changed "interrupt ?" to "Interrupt?". Don't display count down // WALDORF - changed "interrupt ?" to "Interrupt?". Don't display count down
// seconds if the user disables auto progressing interrupts by setting the seconds // seconds if the user disables auto progressing interrupts by setting the seconds
// value to zero in Options. // value to zero in Options.
if (GameOptions::GetInstance()->values[OPTIONS_INTERRUPT_SECONDS].getIntValue() == 0) if (GameOptions::GetInstance()->values[OPTIONS_INTERRUPT_SECONDS].getIntValue() == 0)
sprintf(buffer, _("Interrupt?").c_str()); sprintf(buffer, _("Interrupt?").c_str());
else else
sprintf(buffer, "%s %i", _("Interrupt?").c_str(),static_cast<int>(timer)); sprintf(buffer, "%s %i", _("Interrupt?").c_str(),static_cast<int>(timer));
//WALDORF - removed all the unnecessary math. just display the prompt at the //WALDORF - removed all the unnecessary math. just display the prompt at the
// top of the box. // top of the box.
//mFont->DrawString(buffer, x0 + 5 , currenty - 40 - ((Interruptible *)mObjects[mCount-1])->mHeight); //mFont->DrawString(buffer, x0 + 5 , currenty - 40 - ((Interruptible *)mObjects[mCount-1])->mHeight);
mFont->DrawString(buffer, x0 + 5, y0); mFont->DrawString(buffer, x0 + 5, y0);
if (mCount > 1) sprintf(buffer, _("X Interrupt - 0 No - [] No to All").c_str()); if (mCount > 1) sprintf(buffer, _("X Interrupt - 0 No - [] No to All").c_str());
else sprintf(buffer, _("X Interrupt - 0 No").c_str()); else sprintf(buffer, _("X Interrupt - 0 No").c_str());
// WALDORF - puts the button legend right under the prompt. the stack // WALDORF - puts the button legend right under the prompt. the stack
// will be displayed below it now. no more need to do wierd currY math. // will be displayed below it now. no more need to do wierd currY math.
//mFont->DrawString(buffer, x0 + 5 , currenty); //mFont->DrawString(buffer, x0 + 5 , currenty);
mFont->DrawString(buffer, x0 + 5, y0 + 14); mFont->DrawString(buffer, x0 + 5, y0 + 14);
}else if (mode == ACTIONSTACK_TARGET && modal){ }else if (mode == ACTIONSTACK_TARGET && modal){
for (int i=0;i<mCount ;i++){ for (int i=0;i<mCount ;i++){

View File

@@ -145,6 +145,11 @@ void CardDisplay::Render(){
} }
} }
ostream& CardDisplay::toString(ostream& out) const
{
return (out << "CardDisplay ::: x,y : " << x << "," << y << " ; start_item : " << start_item << " ; nb_displayed_items " << nb_displayed_items << " ; tc : " << tc << " ; listener : " << listener);
}
DefaultTargetDisplay::DefaultTargetDisplay(int id, GameObserver* _game, int _x, int _y,JGuiListener * _listener, int _nb_displayed_items ):CardDisplay(id, _game, _x, _y, _listener, NULL, _nb_displayed_items ){ DefaultTargetDisplay::DefaultTargetDisplay(int id, GameObserver* _game, int _x, int _y,JGuiListener * _listener, int _nb_displayed_items ):CardDisplay(id, _game, _x, _y, _listener, NULL, _nb_displayed_items ){
tc = NEW TargetChooser(); tc = NEW TargetChooser();
} }
@@ -152,3 +157,8 @@ DefaultTargetDisplay::DefaultTargetDisplay(int id, GameObserver* _game, int _x,
DefaultTargetDisplay::~DefaultTargetDisplay(){ DefaultTargetDisplay::~DefaultTargetDisplay(){
SAFE_DELETE(tc); SAFE_DELETE(tc);
} }
std::ostream& operator<<(std::ostream& out, const CardDisplay& m)
{
return m.toString(out);
}

View File

@@ -414,5 +414,7 @@ CardGui::~CardGui(){
LOG("==CardGui object destruction Successful"); LOG("==CardGui object destruction Successful");
} }
ostream& CardGui::toString(ostream& out) const
{
return (out << "CardGui ::: mParticleSys : " << mParticleSys << " ; alpha : " << alpha << " ; card : " << card);
}

View File

@@ -80,6 +80,12 @@ void Damage::Render(){
} }
ostream& Damage::toString(ostream& out) const
{
out << "Damage ::: target : " << target << " ; damage " << damage;
return out;
}
DamageStack::DamageStack(int id, GameObserver * _game):GuiLayer(id, _game), Interruptible(id){ DamageStack::DamageStack(int id, GameObserver * _game):GuiLayer(id, _game), Interruptible(id){
currentState = -1; currentState = -1;
type = ACTION_DAMAGES; type = ACTION_DAMAGES;
@@ -158,3 +164,7 @@ void DamageStack::Render(){
} }
} }
ostream& DamageStack::toString(ostream& out) const
{
return (out << "DamageStack ::: currentState : " << currentState);
}

View File

@@ -584,3 +584,34 @@ JLBFont * mFont = GameApp::CommonRes->GetJLBFont(Constants::MENU_FONT);
break; break;
} }
} }
ostream& GameStateMenu::toString(ostream& out) const
{
return out << "GameStateMenu ::: scroller : " << scroller
<< " ; scrollerSet : " << scrollerSet
<< " ; mGuiController : " << mGuiController
<< " ; subMenuController : " << subMenuController
<< " ; gameTypeMenu : " << gameTypeMenu
<< " ; hasChosenGameType : " << hasChosenGameType
<< " ; mIcons : " << mIcons
<< " ; mIconsTexture : " << mIconsTexture
<< " ; bgTexture : " << bgTexture
<< " ; movingWTexture : " << movingWTexture
<< " ; mBg : " << mBg
<< " ; mMovingW : " << mMovingW
<< " ; splashTex : " << splashTex
<< " ; splashQuad : " << splashQuad
<< " ; mCreditsYPos : " << mCreditsYPos
<< " ; currentState : " << currentState
<< " ; mVolume : " << mVolume
<< " ; nbcardsStr : " << nbcardsStr
<< " ; mDip : " << mDip
<< " ; mDit : " << mDit
<< " ; mCurrentSetName : " << mCurrentSetName
<< " ; mCurrentSetFileName : " << mCurrentSetFileName
<< " ; mReadConf : " << mReadConf
<< " ; timeIndex : " << timeIndex
<< " ; angleMultiplier : " << angleMultiplier
<< " ; angleW : " << angleW
<< " ; yW : " << yW;
}

View File

@@ -1926,6 +1926,17 @@ int MTGAbility::fireAbility(){
return 1; return 1;
} }
ostream& MTGAbility::toString(ostream& out) const
{
return out << "MTGAbility ::: menuText : " << menuText
<< " ; game : " << game
<< " ; forceDestroy : " << forceDestroy
<< " ; cost : " << cost
<< " ; target : " << target
<< " ; aType : " << aType
<< " ; source : " << source;
}
// //
ActivatedAbility::ActivatedAbility(int id, MTGCardInstance * card, ManaCost * _cost, int _playerturnonly,int tap):MTGAbility(id,card), playerturnonly(_playerturnonly), needsTapping(tap){ ActivatedAbility::ActivatedAbility(int id, MTGCardInstance * card, ManaCost * _cost, int _playerturnonly,int tap):MTGAbility(id,card), playerturnonly(_playerturnonly), needsTapping(tap){
@@ -1989,6 +2000,13 @@ int ActivatedAbility::reactToTargetClick(Targetable * object){
} }
ostream& ActivatedAbility::toString(ostream& out) const
{
out << "ActivatedAbility ::: playerturnonly : " << playerturnonly
<< " ; needsTapping : " << needsTapping
<< " (";
return MTGAbility::toString(out) << ")";
}
//The whole targetAbility mechanism is messed up, mainly because of its interactions with //The whole targetAbility mechanism is messed up, mainly because of its interactions with
@@ -2057,6 +2075,11 @@ void TargetAbility::Render(){
//TODO ? //TODO ?
} }
ostream& TargetAbility::toString(ostream& out) const
{
out << "TargetAbility ::: (";
return ActivatedAbility::toString(out) << ")";
}
// //
@@ -2072,6 +2095,11 @@ void TriggeredAbility::Update(float dt){
if (trigger()) fireAbility(); if (trigger()) fireAbility();
} }
ostream& TriggeredAbility::toString(ostream& out) const
{
out << "TriggeredAbility ::: (";
return MTGAbility::toString(out) << ")";
}
// //
@@ -2110,6 +2138,13 @@ int InstantAbility::testDestroy(){
} }
ostream& InstantAbility::toString(ostream& out) const
{
out << "InstantAbility ::: init : " << init
<< " (";
return MTGAbility::toString(out) << ")";
}
void ListMaintainerAbility::Update(float dt){ void ListMaintainerAbility::Update(float dt){
map<MTGCardInstance *,bool>::iterator it=cards.begin(); map<MTGCardInstance *,bool>::iterator it=cards.begin();
@@ -2167,6 +2202,12 @@ int ListMaintainerAbility::destroy(){
return 1; return 1;
} }
ostream& ListMaintainerAbility::toString(ostream& out) const
{
out << "ListMaintainerAbility ::: (";
return MTGAbility::toString(out) << ")";
}
/* An attempt to globalize triggered abilities as much as possible */ /* An attempt to globalize triggered abilities as much as possible */
@@ -2461,3 +2502,18 @@ other solutions need to be provided for abilities that add mana (ex: mana flare)
} }
int AManaProducer::currentlyTapping = 0; int AManaProducer::currentlyTapping = 0;
ostream& AManaProducer::toString(ostream& out) const
{
out << "AManaProducer ::: cost : " << cost
<< " ; output : " << output
<< " ; menutext : " << menutext
<< " ; x0,y0 : " << x0 << "," << y0
<< " ; x1,y1 : " << x1 << "," << y1
<< " ; x,y : " << x << "," << y
<< " ; animation : " << animation
<< " ; controller : " << controller
<< " ; tap : " << tap
<< " (";
return MTGAbility::toString(out) << ")";
}

View File

@@ -53,3 +53,8 @@ bool MTGGamePhase::CheckUserInput(u32 key){
} }
return false; return false;
} }
ostream& MTGGamePhase::toString(ostream& out) const
{
return out << "MTGGamePhase ::: animation " << animation << " ; currentState : " << currentState;
}

View File

@@ -1,427 +1,427 @@
/* This class handles the display on the main game screen : /* This class handles the display on the main game screen :
cards in play, graveyard, library, games phases, Players avatars cards in play, graveyard, library, games phases, Players avatars
*/ */
#include "../include/config.h" #include "../include/config.h"
#include "../include/MTGGuiPlay.h" #include "../include/MTGGuiPlay.h"
#include "../include/MTGCardInstance.h" #include "../include/MTGCardInstance.h"
#include "../include/CardGui.h" #include "../include/CardGui.h"
#include "../include/CardDisplay.h" #include "../include/CardDisplay.h"
#include "../include/Translate.h" #include "../include/Translate.h"
#define ZX_MAIN 100 #define ZX_MAIN 100
#define ZY_MAIN 22 #define ZY_MAIN 22
#define ZH_CREATURES 50 #define ZH_CREATURES 50
#define Z_CARDWIDTH 30 #define Z_CARDWIDTH 30
#define Z_CARDHEIGHT 40 #define Z_CARDHEIGHT 40
#define Z_MAIN_NBCARDS 7 #define Z_MAIN_NBCARDS 7
#define Z_SPELLS_NBCARDS 3 #define Z_SPELLS_NBCARDS 3
#define ZX_SPELL 450 #define ZX_SPELL 450
#define ZY_SPELL 22 #define ZY_SPELL 22
MTGGuiPlay::MTGGuiPlay(int id, GameObserver * _game):PlayGuiObjectController(id, _game){ MTGGuiPlay::MTGGuiPlay(int id, GameObserver * _game):PlayGuiObjectController(id, _game){
currentPlayer = NULL; currentPlayer = NULL;
offset = 0; offset = 0;
mPhaseBarTexture = GameApp::CommonRes->GetTexture("graphics/phasebar.png"); mPhaseBarTexture = GameApp::CommonRes->GetTexture("graphics/phasebar.png");
for (int i=0; i < 12; i++){ for (int i=0; i < 12; i++){
phaseIcons[2*i] = NEW JQuad(mPhaseBarTexture, i*28, 0, 28, 28); phaseIcons[2*i] = NEW JQuad(mPhaseBarTexture, i*28, 0, 28, 28);
phaseIcons[2*i + 1] = NEW JQuad(mPhaseBarTexture, i*28, 28, 28, 28); phaseIcons[2*i + 1] = NEW JQuad(mPhaseBarTexture, i*28, 28, 28, 28);
} }
mGlitter = NEW JQuad(mPhaseBarTexture, 392, 0, 5, 5); mGlitter = NEW JQuad(mPhaseBarTexture, 392, 0, 5, 5);
mGlitter->SetHotSpot(2.5,2.5); mGlitter->SetHotSpot(2.5,2.5);
mGlitterAlpha = -1; mGlitterAlpha = -1;
mFont= GameApp::CommonRes->GetJLBFont("graphics/simon"); mFont= GameApp::CommonRes->GetJLBFont("graphics/simon");
//load all the icon images //load all the icon images
mIcons[Constants::MTG_COLOR_ARTIFACT] = GameApp::CommonRes->GetQuad("c_artifact"); mIcons[Constants::MTG_COLOR_ARTIFACT] = GameApp::CommonRes->GetQuad("c_artifact");
mIcons[Constants::MTG_COLOR_LAND] = GameApp::CommonRes->GetQuad("c_land"); mIcons[Constants::MTG_COLOR_LAND] = GameApp::CommonRes->GetQuad("c_land");
mIcons[Constants::MTG_COLOR_WHITE] = GameApp::CommonRes->GetQuad("c_white"); mIcons[Constants::MTG_COLOR_WHITE] = GameApp::CommonRes->GetQuad("c_white");
mIcons[Constants::MTG_COLOR_RED] = GameApp::CommonRes->GetQuad("c_red"); mIcons[Constants::MTG_COLOR_RED] = GameApp::CommonRes->GetQuad("c_red");
mIcons[Constants::MTG_COLOR_BLACK] = GameApp::CommonRes->GetQuad("c_black"); mIcons[Constants::MTG_COLOR_BLACK] = GameApp::CommonRes->GetQuad("c_black");
mIcons[Constants::MTG_COLOR_BLUE] = GameApp::CommonRes->GetQuad("c_blue"); mIcons[Constants::MTG_COLOR_BLUE] = GameApp::CommonRes->GetQuad("c_blue");
mIcons[Constants::MTG_COLOR_GREEN] = GameApp::CommonRes->GetQuad("c_green"); mIcons[Constants::MTG_COLOR_GREEN] = GameApp::CommonRes->GetQuad("c_green");
for (int i=0; i < 7; i++){ for (int i=0; i < 7; i++){
mIcons[i]->SetHotSpot(16,16); mIcons[i]->SetHotSpot(16,16);
} }
mBgTex = GameApp::CommonRes->GetTexture("graphics/background.png"); mBgTex = GameApp::CommonRes->GetTexture("graphics/background.png");
if (mBgTex) mBg = NEW JQuad(mBgTex, 0, 0, 480, 272); if (mBgTex) mBg = NEW JQuad(mBgTex, 0, 0, 480, 272);
else { else {
mBg = NULL; mBg = NULL;
GameApp::systemError = "error Loading Texture mBgTex in MTGGuiPlay intialization"; GameApp::systemError = "error Loading Texture mBgTex in MTGGuiPlay intialization";
} }
mBgTex2 = GameApp::CommonRes->GetTexture("graphics/back.jpg"); mBgTex2 = GameApp::CommonRes->GetTexture("graphics/back.jpg");
if (mBgTex2){ if (mBgTex2){
mBg2 = NEW JQuad(mBgTex2, 0, 0, 480, 255); mBg2 = NEW JQuad(mBgTex2, 0, 0, 480, 255);
for (int i= 0; i < 4; i++){ for (int i= 0; i < 4; i++){
alphaBg[i] = 255; alphaBg[i] = 255;
} }
}else{ }else{
mBg2 = NULL; mBg2 = NULL;
GameApp::systemError = "error Loading Texture mBgTex2 in MTGGuiPlay intialization"; GameApp::systemError = "error Loading Texture mBgTex2 in MTGGuiPlay intialization";
} }
alphaBg[0] = 0; alphaBg[0] = 0;
AddPlayersGuiInfo(); AddPlayersGuiInfo();
} }
CardGui * MTGGuiPlay::getByCard(MTGCardInstance * card){ CardGui * MTGGuiPlay::getByCard(MTGCardInstance * card){
for (int i = offset; i < mCount; i++){ for (int i = offset; i < mCount; i++){
CardGui * cardg = (CardGui *)mObjects[i]; CardGui * cardg = (CardGui *)mObjects[i];
if(cardg && cardg->card == card){ if(cardg && cardg->card == card){
return cardg; return cardg;
} }
} }
return NULL; return NULL;
} }
void MTGGuiPlay::initCardsDisplay(){ void MTGGuiPlay::initCardsDisplay(){
for (int i = 0; i < SCREEN_WIDTH/5; i++){ for (int i = 0; i < SCREEN_WIDTH/5; i++){
for(int j=0; j < SCREEN_HEIGHT/5; j++){ for(int j=0; j < SCREEN_HEIGHT/5; j++){
cardsGrid[i][j] = NULL; cardsGrid[i][j] = NULL;
} }
} }
cards_x_limit = 12; cards_x_limit = 12;
nb_creatures = 0; nb_creatures = 0;
nb_lands = 0; nb_lands = 0;
nb_spells = 0; nb_spells = 0;
} }
void MTGGuiPlay::adjustCardPosition(CardGui * cardg){ void MTGGuiPlay::adjustCardPosition(CardGui * cardg){
int x5 = cardg->x / 5; int x5 = cardg->x / 5;
int y5 = cardg->y / 5; int y5 = cardg->y / 5;
while (cardsGrid[x5][y5] && x5 <SCREEN_WIDTH/5 && y5 < SCREEN_HEIGHT/5 ){ while (cardsGrid[x5][y5] && x5 <SCREEN_WIDTH/5 && y5 < SCREEN_HEIGHT/5 ){
x5++; x5++;
y5++; y5++;
} }
cardg->x = x5 * 5; cardg->x = x5 * 5;
cardg->y = y5 * 5; cardg->y = y5 * 5;
cardsGrid[x5][y5] = cardg->card; cardsGrid[x5][y5] = cardg->card;
} }
void MTGGuiPlay::setCardPosition(CardGui * cardg, int player, int playerTurn, int spellMode){ void MTGGuiPlay::setCardPosition(CardGui * cardg, int player, int playerTurn, int spellMode){
MTGCardInstance * card = cardg->card; MTGCardInstance * card = cardg->card;
if (card->target) if (card->target)
return; return;
if (spellMode && (card->isACreature() || card->hasType("land"))) return; if (spellMode && (card->isACreature() || card->hasType("land"))) return;
if (!spellMode && !card->isACreature() && !card->hasType("land")) return; if (!spellMode && !card->isACreature() && !card->hasType("land")) return;
if (card->isACreature()){ if (card->isACreature()){
int x_offset = nb_creatures % cards_x_limit; int x_offset = nb_creatures % cards_x_limit;
int y_offset = nb_creatures / cards_x_limit; int y_offset = nb_creatures / cards_x_limit;
cardg->x= ZX_MAIN + (Z_CARDWIDTH * x_offset); cardg->x= ZX_MAIN + (Z_CARDWIDTH * x_offset);
cardg->y=ZY_MAIN + ZH_CREATURES + (Z_CARDHEIGHT * y_offset) + 100 * (1-player); cardg->y=ZY_MAIN + ZH_CREATURES + (Z_CARDHEIGHT * y_offset) + 100 * (1-player);
nb_creatures++; nb_creatures++;
if (playerTurn){ if (playerTurn){
if (card->isAttacker()){ if (card->isAttacker()){
cardg->y=122 + 30 * (1-player); cardg->y=122 + 30 * (1-player);
} }
}else{ }else{
if (card->isDefenser()){ if (card->isDefenser()){
CardGui * targetg = getByCard(card->isDefenser()); CardGui * targetg = getByCard(card->isDefenser());
if (targetg) cardg->x = targetg->x; if (targetg) cardg->x = targetg->x;
cardg->y=122 + 30 * (1-player); cardg->y=122 + 30 * (1-player);
} }
} }
}else if(card->hasType("land")){ }else if(card->hasType("land")){
int x_offset = nb_lands % cards_x_limit; int x_offset = nb_lands % cards_x_limit;
int y_offset = nb_lands/ cards_x_limit; int y_offset = nb_lands/ cards_x_limit;
cardg->x=ZX_MAIN + (Z_CARDWIDTH * x_offset); cardg->x=ZX_MAIN + (Z_CARDWIDTH * x_offset);
cardg->y=ZY_MAIN + (Z_CARDHEIGHT * y_offset) + 200 * (1-player); cardg->y=ZY_MAIN + (Z_CARDHEIGHT * y_offset) + 200 * (1-player);
nb_lands++; nb_lands++;
}else{ }else{
int y_offset = nb_spells % Z_SPELLS_NBCARDS; int y_offset = nb_spells % Z_SPELLS_NBCARDS;
int x_offset = nb_spells/ Z_SPELLS_NBCARDS; int x_offset = nb_spells/ Z_SPELLS_NBCARDS;
cardg->x=ZX_SPELL - (Z_CARDWIDTH * x_offset); cardg->x=ZX_SPELL - (Z_CARDWIDTH * x_offset);
cardg->y=ZY_SPELL + (Z_CARDHEIGHT * y_offset) + 125 * (1-player); cardg->y=ZY_SPELL + (Z_CARDHEIGHT * y_offset) + 125 * (1-player);
nb_spells++; nb_spells++;
cards_x_limit = 12 - (nb_spells + 2)/ Z_SPELLS_NBCARDS; cards_x_limit = 12 - (nb_spells + 2)/ Z_SPELLS_NBCARDS;
} }
adjustCardPosition(cardg); adjustCardPosition(cardg);
} }
void MTGGuiPlay::setTargettingCardPosition(CardGui * cardg, int player, int playerTurn){ void MTGGuiPlay::setTargettingCardPosition(CardGui * cardg, int player, int playerTurn){
MTGCardInstance * card = cardg->card; MTGCardInstance * card = cardg->card;
MTGCardInstance * target = card->target; MTGCardInstance * target = card->target;
if (!target) if (!target)
return; return;
CardGui * targetg = getByCard(target); CardGui * targetg = getByCard(target);
if (targetg){ if (targetg){
cardg->y=targetg->y + 5; cardg->y=targetg->y + 5;
cardg->x=targetg->x + 5; cardg->x=targetg->x + 5;
} }
adjustCardPosition(cardg); adjustCardPosition(cardg);
return; return;
} }
void MTGGuiPlay::forceUpdateCards(){ void MTGGuiPlay::forceUpdateCards(){
GameObserver * game = GameObserver::GetInstance(); GameObserver * game = GameObserver::GetInstance();
Player * player = game->players[0]; Player * player = game->players[0];
int player0Mode =(game->currentPlayer == player); int player0Mode =(game->currentPlayer == player);
int nb_cards = player->game->inPlay->nb_cards; int nb_cards = player->game->inPlay->nb_cards;
resetObjects(); resetObjects();
AddPlayersGuiInfo(); AddPlayersGuiInfo();
offset = mCount; offset = mCount;
bool hasFocus = player0Mode; bool hasFocus = player0Mode;
offset = 6; offset = 6;
Player * opponent = game->players[1]; Player * opponent = game->players[1];
int opponent_cards = opponent ->game->inPlay->nb_cards; int opponent_cards = opponent ->game->inPlay->nb_cards;
for (int i = 0;i<nb_cards; i++){ for (int i = 0;i<nb_cards; i++){
if (hasFocus) mCurr = mCount ; if (hasFocus) mCurr = mCount ;
CardGui * object = NEW CardGui(mCount, player->game->inPlay->cards[i],40, i*35 + 10, 200, hasFocus); CardGui * object = NEW CardGui(mCount, player->game->inPlay->cards[i],40, i*35 + 10, 200, hasFocus);
Add(object); Add(object);
hasFocus = false; hasFocus = false;
} }
hasFocus = !player0Mode; hasFocus = !player0Mode;
for (int i = 0;i<opponent_cards; i++){ for (int i = 0;i<opponent_cards; i++){
if (hasFocus) mCurr = mCount ; if (hasFocus) mCurr = mCount ;
CardGui * object = NEW CardGui(mCount, opponent->game->inPlay->cards[i],40, i*35 + 10, 10, hasFocus); CardGui * object = NEW CardGui(mCount, opponent->game->inPlay->cards[i],40, i*35 + 10, 10, hasFocus);
Add(object); Add(object);
hasFocus = false; hasFocus = false;
} }
currentPlayer = game->currentPlayer; currentPlayer = game->currentPlayer;
} }
void MTGGuiPlay::updateCards(){ void MTGGuiPlay::updateCards(){
GameObserver * game = GameObserver::GetInstance(); GameObserver * game = GameObserver::GetInstance();
Player * player = game->players[0]; Player * player = game->players[0];
int player0Mode =(game->currentPlayer == player); int player0Mode =(game->currentPlayer == player);
int nb_cards = player->game->inPlay->nb_cards; int nb_cards = player->game->inPlay->nb_cards;
MTGCardInstance * attackers[MAX_ATTACKERS]; MTGCardInstance * attackers[MAX_ATTACKERS];
for (int i = 0; i <MAX_ATTACKERS; i++){ for (int i = 0; i <MAX_ATTACKERS; i++){
attackers[i] = NULL; attackers[i] = NULL;
} }
offset = 6; offset = 6;
Player * opponent = game->players[1]; Player * opponent = game->players[1];
int opponent_cards = opponent ->game->inPlay->nb_cards; int opponent_cards = opponent ->game->inPlay->nb_cards;
if (mCount - offset != (nb_cards+opponent_cards) || game->currentPlayer != currentPlayer ){ //if the number of cards has changed, then an update occured (is this test engouh ?) if (mCount - offset != (nb_cards+opponent_cards) || game->currentPlayer != currentPlayer ){ //if the number of cards has changed, then an update occured (is this test engouh ?)
forceUpdateCards(); forceUpdateCards();
} }
//This is just so that we display the cards of the current player first, so that blockers are correctly positionned //This is just so that we display the cards of the current player first, so that blockers are correctly positionned
for (int j= 0; j < 2; j++){ for (int j= 0; j < 2; j++){
initCardsDisplay(); initCardsDisplay();
if (j != player0Mode){ if (j != player0Mode){
for (int i =0; i<nb_cards; i++){ for (int i =0; i<nb_cards; i++){
CardGui * cardGui = (CardGui *)mObjects[i + offset]; CardGui * cardGui = (CardGui *)mObjects[i + offset];
setCardPosition(cardGui, 0, player0Mode, 1); setCardPosition(cardGui, 0, player0Mode, 1);
} }
for (int i =0; i<nb_cards; i++){ for (int i =0; i<nb_cards; i++){
CardGui * cardGui = (CardGui *)mObjects[i + offset]; CardGui * cardGui = (CardGui *)mObjects[i + offset];
setCardPosition(cardGui, 0, player0Mode, 0); setCardPosition(cardGui, 0, player0Mode, 0);
} }
}else{ }else{
for (int i =0; i<opponent_cards; i++){ for (int i =0; i<opponent_cards; i++){
CardGui * cardGui = (CardGui *)mObjects[nb_cards + i + offset]; CardGui * cardGui = (CardGui *)mObjects[nb_cards + i + offset];
setCardPosition(cardGui, 1, !player0Mode,1); setCardPosition(cardGui, 1, !player0Mode,1);
} }
for (int i =0; i<opponent_cards; i++){ for (int i =0; i<opponent_cards; i++){
CardGui * cardGui = (CardGui *)mObjects[nb_cards + i + offset]; CardGui * cardGui = (CardGui *)mObjects[nb_cards + i + offset];
setCardPosition(cardGui, 1, !player0Mode,0); setCardPosition(cardGui, 1, !player0Mode,0);
} }
} }
} }
for (int i =0; i<nb_cards; i++){ for (int i =0; i<nb_cards; i++){
CardGui * cardGui = (CardGui *)mObjects[i + offset ]; CardGui * cardGui = (CardGui *)mObjects[i + offset ];
setTargettingCardPosition(cardGui, 0, player0Mode); setTargettingCardPosition(cardGui, 0, player0Mode);
} }
for (int i =0; i<opponent_cards; i++){ for (int i =0; i<opponent_cards; i++){
CardGui * cardGui = (CardGui *)mObjects[nb_cards + i + offset]; CardGui * cardGui = (CardGui *)mObjects[nb_cards + i + offset];
setTargettingCardPosition(cardGui, 1, !player0Mode); setTargettingCardPosition(cardGui, 1, !player0Mode);
} }
} }
void MTGGuiPlay::AddPlayersGuiInfo(){ void MTGGuiPlay::AddPlayersGuiInfo(){
//init with the players objects //init with the players objects
if (mCount == 0){ if (mCount == 0){
Add(NEW GuiAvatar(-1,50,2,155,false, GameObserver::GetInstance()->players[0])); Add(NEW GuiAvatar(-1,50,2,155,false, GameObserver::GetInstance()->players[0]));
Add(NEW GuiAvatar(-2,50,2,30,false,GameObserver::GetInstance()->players[1])); Add(NEW GuiAvatar(-2,50,2,30,false,GameObserver::GetInstance()->players[1]));
Add(NEW GuiGraveyard(-3,30,40,150,false, GameObserver::GetInstance()->players[0])); Add(NEW GuiGraveyard(-3,30,40,150,false, GameObserver::GetInstance()->players[0]));
Add(NEW GuiLibrary(-4,30,40,180,false, GameObserver::GetInstance()->players[0])); Add(NEW GuiLibrary(-4,30,40,180,false, GameObserver::GetInstance()->players[0]));
Add(NEW GuiGraveyard(-5,30,40,30,false, GameObserver::GetInstance()->players[1])); Add(NEW GuiGraveyard(-5,30,40,30,false, GameObserver::GetInstance()->players[1]));
Add(NEW GuiLibrary(-6,30,40,60,false, GameObserver::GetInstance()->players[1])); Add(NEW GuiLibrary(-6,30,40,60,false, GameObserver::GetInstance()->players[1]));
} }
} }
void MTGGuiPlay::Update(float dt){ void MTGGuiPlay::Update(float dt){
updateCards(); updateCards();
PlayGuiObjectController::Update(dt); PlayGuiObjectController::Update(dt);
} }
bool MTGGuiPlay::CheckUserInput(u32 key){ bool MTGGuiPlay::CheckUserInput(u32 key){
for (int i = 2; i<6;i++){ for (int i = 2; i<6;i++){
GuiGameZone * zone = (GuiGameZone *)mObjects[i]; GuiGameZone * zone = (GuiGameZone *)mObjects[i];
if (zone->showCards){ if (zone->showCards){
return zone->cd->CheckUserInput(key); return zone->cd->CheckUserInput(key);
} }
} }
return PlayGuiObjectController::CheckUserInput(key); return PlayGuiObjectController::CheckUserInput(key);
} }
void MTGGuiPlay::RenderPlayerInfo(int playerid){ void MTGGuiPlay::RenderPlayerInfo(int playerid){
JRenderer * r = JRenderer::GetInstance(); JRenderer * r = JRenderer::GetInstance();
Player * player = GameObserver::GetInstance()->players[playerid]; Player * player = GameObserver::GetInstance()->players[playerid];
//Avatar //Avatar
GuiAvatar * avatar = (GuiAvatar *)mObjects[3*playerid]; GuiAvatar * avatar = (GuiAvatar *)mObjects[3*playerid];
avatar->Render(); avatar->Render();
//Mana //Mana
ManaCost * cost = player->getManaPool(); ManaCost * cost = player->getManaPool();
int nbicons = 0; int nbicons = 0;
for (int j=0; j<6;j++){ for (int j=0; j<6;j++){
int value = cost->getCost(j); int value = cost->getCost(j);
for (int i=0; i<value; i++){ for (int i=0; i<value; i++){
float x = 10 + (nbicons %4) * 15; float x = 10 + (nbicons %4) * 15;
float y = 90 + 125 * (1-playerid) + (15 * (nbicons / 4)); float y = 90 + 125 * (1-playerid) + (15 * (nbicons / 4));
r->RenderQuad(mIcons[j],x,y,0,0.5, 0.5); r->RenderQuad(mIcons[j],x,y,0,0.5, 0.5);
nbicons++; nbicons++;
} }
} }
} }
void MTGGuiPlay::RenderPhaseBar(){ void MTGGuiPlay::RenderPhaseBar(){
GameObserver * game = GameObserver::GetInstance(); GameObserver * game = GameObserver::GetInstance();
JRenderer * renderer = JRenderer::GetInstance(); JRenderer * renderer = JRenderer::GetInstance();
int currentPhase = game->getCurrentGamePhase(); int currentPhase = game->getCurrentGamePhase();
for (int i=0; i < 12; i++){ for (int i=0; i < 12; i++){
int index = 2*i + 1 ; int index = 2*i + 1 ;
if (i==currentPhase-1){ if (i==currentPhase-1){
index-=1; index-=1;
} }
renderer->RenderQuad(phaseIcons[index], 200 + 14*i,0,0,0.5,0.5); renderer->RenderQuad(phaseIcons[index], 200 + 14*i,0,0,0.5,0.5);
} }
if (game->currentlyActing()->isAI()){ if (game->currentlyActing()->isAI()){
mFont->SetColor(ARGB(255,128,128,128)); mFont->SetColor(ARGB(255,128,128,128));
}else{ }else{
mFont->SetColor(ARGB(255,255,255,255)); mFont->SetColor(ARGB(255,255,255,255));
} }
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
mFont->DrawString(_(Constants::MTGPhaseNames[currentPhase]).c_str(), 375, 2); mFont->DrawString(_(Constants::MTGPhaseNames[currentPhase]).c_str(), 375, 2);
} }
void MTGGuiPlay::Render(){ void MTGGuiPlay::Render(){
LOG("Start MTGGuiPlay Render\n"); LOG("Start MTGGuiPlay Render\n");
JRenderer * renderer = JRenderer::GetInstance(); JRenderer * renderer = JRenderer::GetInstance();
//alphaBg[1] = 255; //alphaBg[1] = 255;
//alphaBg[2]= 255; //alphaBg[2]= 255;
//alphaBg[3] = 255; //alphaBg[3] = 255;
//mBg2->SetColor(ARGB(alphaBg[0], alphaBg[1],alphaBg[2],alphaBg[3])); //mBg2->SetColor(ARGB(alphaBg[0], alphaBg[1],alphaBg[2],alphaBg[3]));
renderer->RenderQuad(mBg2,0,17); renderer->RenderQuad(mBg2,0,17);
if (game->currentGamePhase >= Constants::MTG_PHASE_COMBATBEGIN && game->currentGamePhase < Constants::MTG_PHASE_COMBATEND){ if (game->currentGamePhase >= Constants::MTG_PHASE_COMBATBEGIN && game->currentGamePhase < Constants::MTG_PHASE_COMBATEND){
if (alphaBg[0] < 50){ if (alphaBg[0] < 50){
alphaBg[3]-=12; alphaBg[3]-=12;
alphaBg[2]-=12; alphaBg[2]-=12;
alphaBg[0]+=3; alphaBg[0]+=3;
} }
alphaBg[1] = 255; alphaBg[1] = 255;
}else{ }else{
if (alphaBg[0]){ if (alphaBg[0]){
alphaBg[0]-=3; alphaBg[0]-=3;
alphaBg[3]+=12; alphaBg[3]+=12;
alphaBg[2]+=12; alphaBg[2]+=12;
} }
alphaBg[1] = 255; alphaBg[1] = 255;
} }
renderer->FillRect(0,0,480,272,ARGB(alphaBg[0], alphaBg[1],alphaBg[2],alphaBg[3])); renderer->FillRect(0,0,480,272,ARGB(alphaBg[0], alphaBg[1],alphaBg[2],alphaBg[3]));
renderer->RenderQuad(mBg,0,0); renderer->RenderQuad(mBg,0,0);
for (int i=0;i<mCount;i++){ for (int i=0;i<mCount;i++){
if (mObjects[i]!=NULL && i!=mCurr){ if (mObjects[i]!=NULL && i!=mCurr){
mObjects[i]->Render(); mObjects[i]->Render();
} }
} }
RenderPhaseBar(); RenderPhaseBar();
RenderPlayerInfo(0); RenderPlayerInfo(0);
RenderPlayerInfo(1); RenderPlayerInfo(1);
int opponentHand = game->players[1]->game->hand->nb_cards; int opponentHand = game->players[1]->game->hand->nb_cards;
char buffer[10]; char buffer[10];
sprintf(buffer,"%i",opponentHand); sprintf(buffer,"%i",opponentHand);
mFont->SetColor(ARGB(128,0,0,0)); mFont->SetColor(ARGB(128,0,0,0));
mFont->DrawString(buffer, 56, 20); mFont->DrawString(buffer, 56, 20);
mFont->SetColor(ARGB(255,255,255,255)); mFont->SetColor(ARGB(255,255,255,255));
mFont->DrawString(buffer, 54, 18); mFont->DrawString(buffer, 54, 18);
if (mGlitterAlpha < 0){ if (mGlitterAlpha < 0){
mGlitterAlpha = 510; mGlitterAlpha = 510;
int position = rand() % 2; int position = rand() % 2;
if (position){ if (position){
mGlitterX = 65 + rand() % (420); mGlitterX = 65 + rand() % (420);
mGlitterY = 17 + rand() % (5); mGlitterY = 17 + rand() % (5);
}else{ }else{
mGlitterX = 65 + rand() % (5); mGlitterX = 65 + rand() % (5);
mGlitterY = 15 + rand() % (250); mGlitterY = 15 + rand() % (250);
} }
} }
mGlitter->SetColor(ARGB((255-abs(255-mGlitterAlpha)),240,240,255)); mGlitter->SetColor(ARGB((255-abs(255-mGlitterAlpha)),240,240,255));
renderer->RenderQuad(mGlitter,mGlitterX,mGlitterY, (float)(mGlitterAlpha)/(float)255, 1.2*float(mGlitterAlpha)/float(255),1.2*float(mGlitterAlpha)/float(255)); renderer->RenderQuad(mGlitter,mGlitterX,mGlitterY, (float)(mGlitterAlpha)/(float)255, 1.2*float(mGlitterAlpha)/float(255),1.2*float(mGlitterAlpha)/float(255));
mGlitterAlpha-=10; mGlitterAlpha-=10;
if (mCount && mObjects[mCurr] != NULL){ if (mCount && mObjects[mCurr] != NULL){
mObjects[mCurr]->Render(); mObjects[mCurr]->Render();
if (hasFocus && mCurr >= offset && showBigCards && !game->currentlyActing()->isAI() ){ if (hasFocus && mCurr >= offset && showBigCards && !game->currentlyActing()->isAI() ){
//For some reason RenderBig crashes when the testsuite is playing, so we add a "isAI()" test...which was supposed to be there at some point anyways... //For some reason RenderBig crashes when the testsuite is playing, so we add a "isAI()" test...which was supposed to be there at some point anyways...
CardGui * cardg = ((CardGui *)mObjects[mCurr]); CardGui * cardg = ((CardGui *)mObjects[mCurr]);
cardg->RenderBig(-1,-1,showBigCards-1); cardg->RenderBig(-1,-1,showBigCards-1);
} }
} }
LOG("End MTGGuiPlay Render\n"); LOG("End MTGGuiPlay Render\n");
} }
MTGGuiPlay::~MTGGuiPlay(){ MTGGuiPlay::~MTGGuiPlay(){
LOG("==Destroying MTGGuiPlay=="); LOG("==Destroying MTGGuiPlay==");
delete mBg; delete mBg;
//delete mBgTex; //delete mBgTex;
delete mGlitter; delete mGlitter;
for (int i=0; i < 12; i++){ for (int i=0; i < 12; i++){
delete phaseIcons[2*i] ; delete phaseIcons[2*i] ;
delete phaseIcons[2*i + 1]; delete phaseIcons[2*i + 1];
} }
//delete mPhaseBarTexture; //delete mPhaseBarTexture;
SAFE_DELETE(mBg2); SAFE_DELETE(mBg2);
//SAFE_DELETE(mBgTex2); //SAFE_DELETE(mBgTex2);
LOG("==Destroying MTGGuiPlay Successful=="); LOG("==Destroying MTGGuiPlay Successful==");
} }

View File

@@ -77,6 +77,13 @@ int MTGPutInPlayRule::testDestroy(){
return 0; return 0;
} }
ostream& MTGPutInPlayRule::toString(ostream& out) const
{
out << "MTGPutInPlayRule ::: (";
return MTGAbility::toString(out) << ")";
}
MTGAttackRule::MTGAttackRule(int _id):MTGAbility(_id,NULL){ MTGAttackRule::MTGAttackRule(int _id):MTGAbility(_id,NULL){
aType=MTGAbility::MTG_ATTACK_RULE; aType=MTGAbility::MTG_ATTACK_RULE;
} }
@@ -112,7 +119,11 @@ int MTGAttackRule::testDestroy(){
return 0; return 0;
} }
ostream& MTGAttackRule::toString(ostream& out) const
{
out << "MTGAttackRule ::: (";
return MTGAbility::toString(out) << ")";
}
MTGBlockRule::MTGBlockRule(int _id):MTGAbility(_id,NULL){ MTGBlockRule::MTGBlockRule(int _id):MTGAbility(_id,NULL){
aType=MTGAbility::MTG_BLOCK_RULE; aType=MTGAbility::MTG_BLOCK_RULE;
@@ -149,6 +160,11 @@ int MTGBlockRule::testDestroy(){
return 0; return 0;
} }
ostream& MTGBlockRule::toString(ostream& out) const
{
out << "MTGBlockRule ::: (";
return MTGAbility::toString(out) << ")";
}
// //
// * Momir // * Momir
@@ -259,4 +275,10 @@ void MTGMomirRule::Render(){
mFont->SetScale(2 - (float)textAlpha/130); mFont->SetScale(2 - (float)textAlpha/130);
mFont->SetColor(ARGB(textAlpha,255,255,255)); mFont->SetColor(ARGB(textAlpha,255,255,255));
mFont->DrawString(text.c_str(),SCREEN_WIDTH/2,SCREEN_HEIGHT/2,JGETEXT_CENTER); mFont->DrawString(text.c_str(),SCREEN_WIDTH/2,SCREEN_HEIGHT/2,JGETEXT_CENTER);
} }
ostream& MTGMomirRule::toString(ostream& out) const
{
out << "MTGMomirRule ::: pool : " << pool << " ; initialized : " << initialized << " ; textAlpha : " << textAlpha << " ; text " << text << " ; alreadyplayed : " << alreadyplayed << " ; collection : " << collection << "(";
return MTGAbility::toString(out) << ")";
}

View File

@@ -400,4 +400,9 @@ void ManaCost::Dump(){
OutputDebugString("\n=============\n"); OutputDebugString("\n=============\n");
} }
#endif #endif
ostream& operator<<(ostream& out, const ManaCost& m)
{
return out << "(manacost)";
}

View File

@@ -103,3 +103,18 @@ bool MenuItem::ButtonPressed()
MenuItem::~MenuItem(){ MenuItem::~MenuItem(){
if (mParticleSys) delete mParticleSys; if (mParticleSys) delete mParticleSys;
} }
ostream& MenuItem::toString(ostream& out) const
{
return out << "MenuItem ::: mHasFocus : " << mHasFocus
<< " ; mFont : " << mFont
<< " ; mText : " << mText
<< " ; mX,mY : " << mX << "," << mY
<< " ; updatedSinceLastRender : " << updatedSinceLastRender
<< " ; lastDt : " << lastDt
<< " ; mScale : " << mScale
<< " ; mTargetScale : " << mTargetScale
<< " ; onQuad : " << onQuad
<< " ; offQuad : " << offQuad
<< " ; mParticleSys : " << mParticleSys;
}

View File

@@ -121,3 +121,14 @@ void OptionsList::Update(float dt){
options[i]->Update(dt); options[i]->Update(dt);
} }
} }
ostream& OptionItem::toString(ostream& out) const
{
return out << "OptionItem ::: displayValue : " << displayValue
<< " ; id : " << id
<< " ; value : " << value
<< " ; hasFocus : " << hasFocus
<< " ; maxValue : " << maxValue
<< " ; increment : " << increment
<< " ; x,y : " << x << "," << y;
}

View File

@@ -88,6 +88,13 @@ void GuiAvatar::Render(){
mFont->DrawString(buffer, x+1,y+38); mFont->DrawString(buffer, x+1,y+38);
} }
ostream& GuiAvatar::toString(ostream& out) const
{
return out << "GuiAvatar ::: avatarRed : " << avatarRed
<< " ; currentLife : " << currentLife
<< " ; player : " << player;
}
void GuiGameZone::toggleDisplay(){ void GuiGameZone::toggleDisplay(){
if (showCards){ if (showCards){
@@ -140,12 +147,28 @@ GuiGameZone::~GuiGameZone(){
if(cd) delete cd; if(cd) delete cd;
} }
ostream& GuiGameZone::toString(ostream& out) const
{
return out << "GuiGameZone ::: zone : " << zone
<< " ; cd : " << cd
<< " ; showCards : " << showCards;
}
GuiGraveyard::GuiGraveyard(int id, float desiredHeight,float _x, float _y, bool hasFocus,Player * player):GuiGameZone(id, desiredHeight, _x, _y, hasFocus,player->game->graveyard){ GuiGraveyard::GuiGraveyard(int id, float desiredHeight,float _x, float _y, bool hasFocus,Player * player):GuiGameZone(id, desiredHeight, _x, _y, hasFocus,player->game->graveyard){
type= GUI_GRAVEYARD; type= GUI_GRAVEYARD;
} }
ostream& GuiGraveyard::toString(ostream& out) const
{
return out << "GuiGraveyard :::";
}
GuiLibrary::GuiLibrary(int id, float desiredHeight,float _x, float _y, bool hasFocus,Player * player):GuiGameZone(id, desiredHeight, _x, _y, hasFocus,player->game->library){ GuiLibrary::GuiLibrary(int id, float desiredHeight,float _x, float _y, bool hasFocus,Player * player):GuiGameZone(id, desiredHeight, _x, _y, hasFocus,player->game->library){
type = GUI_LIBRARY; type = GUI_LIBRARY;
} }
ostream& GuiLibrary::toString(ostream& out) const
{
return out << "GuiLibrary :::";
}

View File

@@ -304,3 +304,20 @@ ShopItems::~ShopItems(){
safeDeleteDisplay(); safeDeleteDisplay();
SAFE_DELETE(myCollection); SAFE_DELETE(myCollection);
} }
ostream& ShopItem::toString(ostream& out) const
{
return out << "ShopItem ::: mHasFocus : " << mHasFocus
<< " ; mFont : " << mFont
<< " ; mText : " << mText
<< " ; mX,mY : " << mX << "," << mY
<< " ; quad : " << quad
<< " ; thumb : " << thumb
<< " ; mScale : " << mScale
<< " ; mTargetScale : " << mTargetScale
<< " ; mDDW : " << mDDW
<< " ; nameCount : " << nameCount
<< " ; quantity : " << quantity
<< " ; card : " << card
<< " ; price : " << price;
}

View File

@@ -78,3 +78,14 @@ bool SimpleMenuItem::hasFocus()
{ {
return mHasFocus; return mHasFocus;
} }
ostream& SimpleMenuItem::toString(ostream& out) const
{
return out << "SimpleMenuItem ::: mHasFocus : " << mHasFocus
<< " ; parent : " << parent
<< " ; mFont : " << mFont
<< " ; mText : " << mText
<< " ; mScale : " << mScale
<< " ; mTargetScale : " << mTargetScale
<< " ; mX,mY : " << mX << "," << mY;
}

View File

@@ -48,4 +48,19 @@ void TextScroller::Update(float dt){
void TextScroller::Render(){ void TextScroller::Render(){
mFont->DrawString(mText.c_str(),mX,mY,JGETEXT_LEFT,start,mWidth); mFont->DrawString(mText.c_str(),mX,mY,JGETEXT_LEFT,start,mWidth);
} }
ostream& TextScroller::toString(ostream& out) const
{
return out << "TextScroller ::: mText : " << mText
<< " ; tempText : " << tempText
<< " ; mFont : " << mFont
<< " ; mWidth : " << mWidth
<< " ; mSpeed : " << mSpeed
<< " ; mX,mY : " << mX << "," << mY
<< " ; start : " << start
<< " ; timer : " << timer
<< " ; strings : ?" // << strings
<< " ; currentId : " << currentId
<< " ; mRandom : " << mRandom;
}