Hello everybody,
On PHP side, I have a function for transfering a card from some place to another (called self::transferCardFromTo).
Its execution can trigger the end of the game under some conditions. In that case, the game must stop immediately after this function has returned.
As far as I understand, to finish a game properly I have to do two things:
Is there a way to stop in place the execution of this stack? Can I throw a particular exception to do that?
Thanks a lot!
Tchebychev
PS: I want to apologise if I'm not clear in this message : There are a lot of technical terms I'm not familiar with in English so do not hesitate to make me rephrase.
On PHP side, I have a function for transfering a card from some place to another (called self::transferCardFromTo).
Its execution can trigger the end of the game under some conditions. In that case, the game must stop immediately after this function has returned.
As far as I understand, to finish a game properly I have to do two things:
- Call $this->gamestate->nextState('gameEnd'); which is the job of self::transferCardFromTo
- Clear the stack of the parent functions which last child was the call for self::transferCardFromTo
Is there a way to stop in place the execution of this stack? Can I throw a particular exception to do that?
Thanks a lot!
Tchebychev
PS: I want to apologise if I'm not clear in this message : There are a lot of technical terms I'm not familiar with in English so do not hesitate to make me rephrase.