Files
wagic/projects/mtg/include/CardSelectorSingleton.h
wrenczes@gmail.com 5a1e8e6ffe More reorganization work around CardSelector and the singleton pattern. Broke the source for the singleton into its own separate source file, to keep things clean. Also broke apart a circular header dependency: CardSelector defines and uses a SelectorZone, which is a member inside of CardView. CardView in turn is used heavily by CardSelector. Instead SelectorZone is now defined within CardView (where it's set & controlled anyway).
I've also added my current work on the zone navigation system (class Navigator) - it's currently turned off for now (the override for this is inside of CardSelectorSingleton's Instance() call, simply comment out the NEW CardSelector and uncomment out the NEW Navigator line.)  It's functional, but I want to do more testing before considering wiring it into the game options or something similar.  (Also, note that it currently doesn't support the mouse functionality added by DJardin.)

Lastly, there's a bug crash fix in ActionStack that I tripped across while testing - basically, an illegal index value would have us walk off the bounds of a vector.
2010-10-31 07:50:53 +00:00

30 lines
784 B
C++

#ifndef CARDSELECTORSINGLETON_H
#define CARDSELECTORSINGLETON_H
#include "CardSelector.h"
class DuelLayers;
namespace CardSelectorSingleton
{
/*
** CardSelector is essentially a singleton in its usage
** It's not enforced, but it needs to eventually migrate to the real thing
** For now, this function will fake it out - it's up to the client caller to make sure
** that this gets destroyed via a Terminate call (this is currently handled in DualLayers's destructor)
*/
CardSelectorBase* Instance();
/*
** Create the singleton pointer. Instance() isn't valid until this is called.
*/
CardSelectorBase* Create(DuelLayers* inDuelLayers);
/*
** Teardown the singleton pointer instance.
*/
void Terminate();
}
#endif //CARDSELECTORSINGLETON_H