- reimplement r2609 with inheritance, and cleaned up the function code.
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-11-14 01:35:26 +00:00
parent d668fbb45c
commit b934f0a5ab
4 changed files with 22 additions and 72 deletions
+15 -2
View File
@@ -26,6 +26,19 @@ float GameStateShop::_y3[] = {164,205,257,184,180,170,219,212,195,251,252};
float GameStateShop::_x4[] = { 76, 90, 65,131,171,221,123,187,225,141,237};
float GameStateShop::_y4[] = {169,188,250,182,182,168,220,208,198,259,245};
BoosterDisplay::BoosterDisplay(int id, GameObserver* game, int x, int y, JGuiListener * listener, TargetChooser * tc, int nb_displayed_items):
CardDisplay(id, game,x,y,listener,tc,nb_displayed_items){}
bool BoosterDisplay::CheckUserInput(JButton key){
if (JGE_BTN_UP == key || JGE_BTN_DOWN == key)
return false;
return CardDisplay::CheckUserInput(key);
}
GameStateShop::GameStateShop(GameApp* parent): GameState(parent) {
menu = NULL;
for(int i=0;i<8;i++)
@@ -252,7 +265,7 @@ void GameStateShop::purchaseBooster(int controlId){
SAFE_DELETE(booster);
deleteDisplay();
booster = NEW MTGDeck(mParent->collection);
boosterDisplay = NEW CardDisplay(12,NULL, SCREEN_WIDTH - 200, SCREEN_HEIGHT/2,this,NULL,5);
boosterDisplay = NEW BoosterDisplay(12,NULL, SCREEN_WIDTH - 200, SCREEN_HEIGHT/2,this,NULL,5);
mBooster[controlId].addToDeck(booster,srcCards);
string sort = mBooster[controlId].getSort();
@@ -519,7 +532,7 @@ void GameStateShop::Update(float dt)
if (btn == JGE_BTN_SEC)
deleteDisplay();
else {
boosterDisplay->CheckUserInputSHOP(btn);
boosterDisplay->CheckUserInput(btn);
boosterDisplay->Update(dt);}
return;
}else if (btn == JGE_BTN_SEC)