J :
* Add newlines at end of files. This is for better portability. * Fix a direct reference to g++ in the makefile
This commit is contained in:
@@ -92,4 +92,4 @@ AttackerDamaged::AttackerDamaged(MTGCardInstance* card, const Pos& ref, bool sho
|
||||
AttackerDamaged::~AttackerDamaged(){
|
||||
for (vector<DefenserDamaged*>::iterator q = blockers.begin(); q != blockers.end(); ++q)
|
||||
delete(*q);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
#include "../include/DeckMetaData.h"
|
||||
#include "../include/MTGDeck.h"
|
||||
#include "../include/config.h"
|
||||
//Possible improvements:
|
||||
//Merge this with DeckStats
|
||||
//Have this class handle all the Meta Data rather than relying on MTGDeck. Then MTGDeck would have a MetaData object...
|
||||
|
||||
|
||||
DeckMetaDataList * DeckMetaDataList::decksMetaData = NEW DeckMetaDataList();
|
||||
|
||||
#include "../include/DeckMetaData.h"
|
||||
#include "../include/MTGDeck.h"
|
||||
#include "../include/config.h"
|
||||
//Possible improvements:
|
||||
//Merge this with DeckStats
|
||||
//Have this class handle all the Meta Data rather than relying on MTGDeck. Then MTGDeck would have a MetaData object...
|
||||
|
||||
|
||||
DeckMetaDataList * DeckMetaDataList::decksMetaData = NEW DeckMetaDataList();
|
||||
|
||||
DeckMetaData::DeckMetaData(string filename){
|
||||
load(filename);
|
||||
}
|
||||
void DeckMetaData::load(string filename){
|
||||
MTGDeck * mtgd = NEW MTGDeck(filename.c_str(),NULL,1);
|
||||
name = mtgd->meta_name;
|
||||
desc = mtgd->meta_desc;
|
||||
delete(mtgd);
|
||||
}
|
||||
|
||||
DeckMetaDataList::~DeckMetaDataList(){
|
||||
for(map<string,DeckMetaData *>::iterator it = values.begin(); it != values.end(); ++it){
|
||||
SAFE_DELETE(it->second);
|
||||
}
|
||||
values.clear();
|
||||
}
|
||||
|
||||
void DeckMetaDataList::invalidate(string filename){
|
||||
map<string,DeckMetaData *>::iterator it = values.find(filename);
|
||||
if (it !=values.end()){
|
||||
SAFE_DELETE(it->second);
|
||||
values.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
DeckMetaData * DeckMetaDataList::get(string filename){
|
||||
map<string,DeckMetaData *>::iterator it = values.find(filename);
|
||||
if (it ==values.end()){
|
||||
if (fileExists(filename.c_str())) {
|
||||
values[filename] = NEW DeckMetaData(filename);
|
||||
}
|
||||
}
|
||||
|
||||
return values[filename]; //this creates a NULL entry if the file does not exist
|
||||
}
|
||||
void DeckMetaData::load(string filename){
|
||||
MTGDeck * mtgd = NEW MTGDeck(filename.c_str(),NULL,1);
|
||||
name = mtgd->meta_name;
|
||||
desc = mtgd->meta_desc;
|
||||
delete(mtgd);
|
||||
}
|
||||
|
||||
DeckMetaDataList::~DeckMetaDataList(){
|
||||
for(map<string,DeckMetaData *>::iterator it = values.begin(); it != values.end(); ++it){
|
||||
SAFE_DELETE(it->second);
|
||||
}
|
||||
values.clear();
|
||||
}
|
||||
|
||||
void DeckMetaDataList::invalidate(string filename){
|
||||
map<string,DeckMetaData *>::iterator it = values.find(filename);
|
||||
if (it !=values.end()){
|
||||
SAFE_DELETE(it->second);
|
||||
values.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
DeckMetaData * DeckMetaDataList::get(string filename){
|
||||
map<string,DeckMetaData *>::iterator it = values.find(filename);
|
||||
if (it ==values.end()){
|
||||
if (fileExists(filename.c_str())) {
|
||||
values[filename] = NEW DeckMetaData(filename);
|
||||
}
|
||||
}
|
||||
|
||||
return values[filename]; //this creates a NULL entry if the file does not exist
|
||||
}
|
||||
|
||||
@@ -394,4 +394,4 @@ void GameApp::DoTransition(int trans, int tostate, float dur, bool animonly){
|
||||
|
||||
void GameApp::DoAnimation(int trans, float dur){
|
||||
DoTransition(trans,GAME_STATE_NONE,dur,true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,4 +44,4 @@ int GameState::fillDeckMenu(SimpleMenu * _menu, string path, string smallDeckPre
|
||||
}
|
||||
}
|
||||
return nbDecks;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,4 +349,4 @@ void GameStateAwards::ButtonPressed(int controllerId, int controlId)
|
||||
mState = STATE_DETAILS;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,4 +235,4 @@ void GameStateOptions::ButtonPressed(int controllerId, int controlId)
|
||||
}
|
||||
else
|
||||
optionsTabs->ButtonPressed(controllerId, controlId);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -256,4 +256,4 @@ void GameStateShop::ButtonPressed(int controllerId, int controlId)
|
||||
}
|
||||
SAFE_DELETE(menu);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,4 +53,4 @@ void TransitionFade::Render(){
|
||||
TransitionFade::TransitionFade(GameApp* p, GameState* f, GameState* t, float dur, bool reversed):
|
||||
TransitionBase(p, f,t,dur) {
|
||||
mReversed = reversed;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -72,4 +72,4 @@ char * MTGCard::getImageName(){
|
||||
|
||||
void MTGCard::setPrimitive(CardPrimitive * cp){
|
||||
data = cp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1632,4 +1632,4 @@ bool WSrcMTGSet::thisCard(int mtgid){
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -551,4 +551,4 @@ bool ShopItems::CheckUserInput(u32 key){
|
||||
return dialog->CheckUserInput(key);
|
||||
|
||||
return JGuiController::CheckUserInput(key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,4 +184,4 @@ void SimpleMenu::destroy(){
|
||||
SAFE_DELETE(SimpleMenu::jewel);
|
||||
SAFE_DELETE(SimpleMenu::stars);
|
||||
SAFE_DELETE(SimpleMenu::jewelTex);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user