MyGame.Mediator.register C# (CSharp) Method

register() public method

public register ( IEvent ie ) : void
ie IEvent
return void
        public void register(IEvent ie,params MyEvent[] eventKey)
        {
            foreach (int ev in eventKey)
            {
                if (hash[ev] != null)
                {
                    ((List<IEvent>)hash[ev]).Add(ie);
                }
                else
                {
                    List<IEvent> list = new List<IEvent>();
                    list.Add(ie);
                    hash[ev] = list;
                }
            }
        }

Usage Example

Example #1
0
        //assal
        // Shot variables
        //int keyDelay = 800;
        //int keyCountdown = 0;
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            controller = new Controller(Constants.LEFT_HAND);

            //DONT Remove i need this.--Mahmoud Bahaa
            if (System.IO.File.Exists("fbDeprofiler.dll"))
                fbDeprofiler.DeProfiler.Run();

            Window.AllowUserResizing = true;

            mediator = new Mediator();
            events = new List<Event>();
            delayedAction = new DelayedAction(800);
            delayedAction2 = new DelayedAction();
            mediator.register(this, MyEvent.G_StartGame, MyEvent.G_StartScreen, MyEvent.G_HelpScreen, MyEvent.G_Exit);
            //mediator.fireEvent(MyEvent.G_StartGame);
        }
All Usage Examples Of MyGame.Mediator::register