This commit is contained in:
wagic.the.homebrew
2008-11-02 09:50:16 +00:00
commit d45e3b101b
726 changed files with 179125 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
#include "../include/debug.h"
#include "../include/DuelLayers.h"
#include "../include/MTGRules.h"
#include "../include/DamageResolverLayer.h"
void DuelLayers::init(){
//0 Stack Layer
ActionStack * mActionStack = NEW ActionStack(0, GameObserver::GetInstance());
//Damage Resolver
DamageResolverLayer * mDamageResolver = NEW DamageResolverLayer(1, GameObserver::GetInstance());
//1 Action Layer
GuiLayer * actionLayer = NEW ActionLayer(2, GameObserver::GetInstance());
MTGGamePhase * phaseManager = NEW MTGGamePhase(actionLayer->getMaxId());
actionLayer->Add(phaseManager);
//Add Magic Specific Rules
actionLayer->Add(NEW MTGAttackRule(-1));
actionLayer->Add(NEW MTGBlockRule(-1));
actionLayer->Add(NEW MTGLegendRule(-1));
actionLayer->Add(NEW MTGPersistRule(-1));
//2 Hand Layer
MTGGuiHand * mGuiHand = NEW MTGGuiHand(3, GameObserver::GetInstance());
//3 Game
MTGGuiPlay * play = NEW MTGGuiPlay(4, GameObserver::GetInstance());
Add(mActionStack);
Add(mDamageResolver);
Add(actionLayer);
Add(mGuiHand);
Add(play);
}
ActionStack * DuelLayers::stackLayer(){
return ((ActionStack *) (objects[0]));
}
DamageResolverLayer * DuelLayers::combatLayer(){
return ((DamageResolverLayer *) (objects[1]));
}
ActionLayer * DuelLayers::actionLayer(){
return ((ActionLayer *) (objects[2]));
}
MTGGuiHand * DuelLayers::handLayer(){
return ((MTGGuiHand *) (objects[3]));
}
MTGGuiPlay * DuelLayers::playLayer(){
return ((MTGGuiPlay *) (objects[4]));
}