- Added WEvent class, allows to send events to abilities
- Cards that change zones now becomes new objects (as specified in the Comprehensive rules). This should allow to fix lots of stupid bugs in the near future, but probably brings loads of new issues :(
This commit is contained in:
wagic.the.homebrew
2009-02-16 13:46:14 +00:00
parent db90797fb0
commit f87c703866
22 changed files with 307 additions and 112 deletions

View File

@@ -2,6 +2,7 @@
#include "../include/ActionLayer.h"
#include "../include/GameObserver.h"
#include "../include/Targetable.h"
#include "../include/WEvent.h"
int ActionLayer::unstopableRenderInProgress(){
@@ -93,6 +94,23 @@ int ActionLayer::isWaitingForAnswer(){
return 0;
}
int ActionLayer::stillInUse(MTGCardInstance * card){
for (int i=0;i<mCount;i++){
ActionElement * currentAction = (ActionElement *)mObjects[i];
if(currentAction->stillInUse(card)) return 1;
}
return 0;
}
int ActionLayer::receiveEvent(WEvent * event){
int result = 0;
for (int i=0;i<mCount;i++){
ActionElement * currentAction = (ActionElement *)mObjects[i];
result += currentAction->receiveEvent(event);
}
return result;
}
int ActionLayer::isReactingToTargetClick(Targetable * card){
int result = 0;