More work on cleaning up debug trace logs. Added getDisplayName() overrides to the Ability & NextGamePhase interrupts so that there's now more contextual info in the output log. You'll now see what game phase is being added/resolved on the stack, and instead of a generic 'StackAbility' entry, it'll tell you what source it's coming from.
Also deleted a few debug output traces that were truly uninformative.
This commit is contained in:
@@ -71,6 +71,7 @@ class NextGamePhase: public Interruptible {
|
|||||||
bool extraDamagePhase();
|
bool extraDamagePhase();
|
||||||
void Render();
|
void Render();
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
|
virtual const string getDisplayName() const;
|
||||||
NextGamePhase(int id);
|
NextGamePhase(int id);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -112,6 +113,7 @@ class StackAbility: public Interruptible {
|
|||||||
int resolve();
|
int resolve();
|
||||||
void Render();
|
void Render();
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
|
virtual const string getDisplayName() const;
|
||||||
StackAbility(int id, MTGAbility * _ability);
|
StackAbility(int id, MTGAbility * _ability);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,13 @@ int NextGamePhase::resolve(){
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const string NextGamePhase::getDisplayName() const
|
||||||
|
{
|
||||||
|
std::ostringstream stream;
|
||||||
|
stream << "NextGamePhase. (Current phase is: " << PhaseRing::phaseName(GameObserver::GetInstance()->getCurrentGamePhase()) << ")";
|
||||||
|
|
||||||
|
return stream.str();
|
||||||
|
}
|
||||||
|
|
||||||
void NextGamePhase::Render(){
|
void NextGamePhase::Render(){
|
||||||
GameObserver * g = GameObserver::GetInstance();
|
GameObserver * g = GameObserver::GetInstance();
|
||||||
@@ -145,6 +151,14 @@ ostream& StackAbility::toString(ostream& out) const
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const string StackAbility::getDisplayName() const
|
||||||
|
{
|
||||||
|
std::ostringstream stream;
|
||||||
|
stream << "StackAbility. (Source: " << ability->source->getDisplayName() << ")";
|
||||||
|
|
||||||
|
return stream.str();
|
||||||
|
}
|
||||||
|
|
||||||
/* Spell Cast */
|
/* Spell Cast */
|
||||||
|
|
||||||
Spell::Spell(MTGCardInstance * _source): Interruptible(0){
|
Spell::Spell(MTGCardInstance * _source): Interruptible(0){
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "../include/config.h"
|
#include "../include/config.h"
|
||||||
|
#include "../include/DebugRoutines.h"
|
||||||
#include "../include/GameObserver.h"
|
#include "../include/GameObserver.h"
|
||||||
#include "../include/GameOptions.h"
|
#include "../include/GameOptions.h"
|
||||||
#include "../include/CardGui.h"
|
#include "../include/CardGui.h"
|
||||||
@@ -380,9 +381,7 @@ void GameObserver::Render()
|
|||||||
|
|
||||||
|
|
||||||
void GameObserver::ButtonPressed(PlayGuiObject * target){
|
void GameObserver::ButtonPressed(PlayGuiObject * target){
|
||||||
#if defined (WIN32) || defined (LINUX)
|
DebugTrace("GAMEOBSERVER Click");
|
||||||
OutputDebugString("GAMEOBSERVER Click\n");
|
|
||||||
#endif
|
|
||||||
if (CardView* cardview = dynamic_cast<CardView*>(target)){
|
if (CardView* cardview = dynamic_cast<CardView*>(target)){
|
||||||
MTGCardInstance * card = cardview->getCard();
|
MTGCardInstance * card = cardview->getCard();
|
||||||
cardClick(card, card);
|
cardClick(card, card);
|
||||||
|
|||||||
@@ -633,11 +633,6 @@ void GameSettings::checkProfile(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GameSettings::createUsersFirstDeck(int setId){
|
void GameSettings::createUsersFirstDeck(int setId){
|
||||||
#if defined (WIN32) || defined (LINUX)
|
|
||||||
char buf[4096];
|
|
||||||
sprintf(buf, "setID: %i", setId);
|
|
||||||
OutputDebugString(buf);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(theGame == NULL || theGame->collection == NULL)
|
if(theGame == NULL || theGame->collection == NULL)
|
||||||
return;
|
return;
|
||||||
@@ -659,19 +654,11 @@ void GameSettings::createUsersFirstDeck(int setId){
|
|||||||
if (!mCollection->addRandomCards(10, sets,1,Constants::RARITY_L,"Island"))
|
if (!mCollection->addRandomCards(10, sets,1,Constants::RARITY_L,"Island"))
|
||||||
mCollection->addRandomCards(10, 0,0,Constants::RARITY_L,"Island");
|
mCollection->addRandomCards(10, 0,0,Constants::RARITY_L,"Island");
|
||||||
|
|
||||||
|
|
||||||
#if defined (WIN32) || defined (LINUX)
|
|
||||||
OutputDebugString("1\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//Starter Deck
|
//Starter Deck
|
||||||
mCollection->addRandomCards(3, sets,1,Constants::RARITY_R,NULL);
|
mCollection->addRandomCards(3, sets,1,Constants::RARITY_R,NULL);
|
||||||
mCollection->addRandomCards(9, sets,1,Constants::RARITY_U,NULL);
|
mCollection->addRandomCards(9, sets,1,Constants::RARITY_U,NULL);
|
||||||
mCollection->addRandomCards(48, sets,1,Constants::RARITY_C,NULL);
|
mCollection->addRandomCards(48, sets,1,Constants::RARITY_C,NULL);
|
||||||
|
|
||||||
#if defined (WIN32) || defined (LINUX)
|
|
||||||
OutputDebugString("2\n");
|
|
||||||
#endif
|
|
||||||
//Boosters
|
//Boosters
|
||||||
for (int i = 0; i< 2; i++){
|
for (int i = 0; i< 2; i++){
|
||||||
mCollection->addRandomCards(1, sets,1,Constants::RARITY_R);
|
mCollection->addRandomCards(1, sets,1,Constants::RARITY_R);
|
||||||
|
|||||||
Reference in New Issue
Block a user