Thinking about the assignment of secret missions, maybe we should add
an optional class in the game plugin which can be a game delegate.
This can add a hook for the plugin to do additional things beyond the
triggers and actions, like throw up a custom window, alert, or
dialogue box.
For example, say we have the ViciMissionRiskGame class. in the -
initWithGameContext: method it instantiates another class which
conforms to the ViciGameDelegate protocol and assigns it to the game.
Problem: the ViciMissionRiskGame class can't set the game's delegate,
it can only access to the context.
Try again:
The VMRG class already knows the players and the map. Right? So it
can create triggers/actions which say, for example, if Player A
acquires Iceland and Venezuela he wins. The user needs to be notified
of this so that he knows what his missions are. We can't simply make
a trigger/action for this, since there is no way (theoretically) to
tell the game engine what window to show and how to show it and who to
show it to. So we place in the game plugin plist a key like
ViciGameDelegateClass which is a string with the name of the class to
be the games delegate. It's then the ViciGameFactory's responsibility
to instantiate this class and make it the delegate. Then when the
class receives the -gameWillBegin: method, it can put up the custom
window with the necessary information.
I think that works.
Any thoughts?
Cory
Now say we have a ViciCapitalRiskGame plugin. We will need some post-
configuration for the game since we can't assign capitals until all
the countries are assigned, which traditionally is done by choosing
countries in turn. This is another place where a delegate would be
useful in custom games.
On Oct 21, 2009, at 3:31 PM, Cory Kilger wrote:
> Ah, but there's more.
>
> Now say we have a ViciCapitalRiskGame plugin. We will need some
> post-configuration for the game since we can't assign capitals until
Dave
Dave
>>>> -gameWillBegin: method, it can put up the custom window with the