public void doGameEvent(GameBoardEvent ev)
    {
        bool res = ev.doEvent();

        print(res);
        printPlayerPos();
    }
 private void Update()
 {
     if ((events != null) && (!events.isEmpty()))
     {
         GameBoardEvent e = events.Dequeue();
         e.doEvent();
     }
 }
    public override void OnNotification(string p_event_path, UnityEngine.Object p_target, params object[] p_data)
    {
        GameBoardModel gb     = app.game_board_model;
        GameBoardEvent action = null;

        switch (p_event_path)
        {
        case "user.press.up":
        {
            ActorMoveEvent a = gameObject.AddComponent <ActorMoveEventUp>();
            a.addActor(gb.player);
            action = a;
            break;
        }

        case "user.press.down":
        {
            ActorMoveEvent a = gameObject.AddComponent <ActorMoveEventDown>();
            a.addActor(gb.player);
            action = a;
            break;
        }

        case "user.press.left":
        {
            ActorMoveEvent a = gameObject.AddComponent <ActorMoveEventLeft>();
            a.addActor(gb.player);
            action = a;
            break;
        }

        case "user.press.right":
        {
            ActorMoveEvent a = gameObject.AddComponent <ActorMoveEventRight>();
            a.addActor(gb.player);
            action = a;
            break;
        }

        case "user.undo":
        {
            GameBoardEvent a = gameObject.AddComponent <GameBoardUndoEvent>();
            action = a;
            break;
        }
        }

        if (action != null)
        {
            gb.events.Enqueue(action);
        }
    }
    // Update is called once per frame
    void Update()
    {
        if ((gbEventQueue != null) && (!gbEventQueue.isEmpty()))
        {
            GameBoardEvent cur = gbEventQueue.Dequeue();
            this.doGameEvent(cur);
        }

        for (int row = 0; row < board.Count; row++)
        {
            for (int col = 0; col < board[row].Count; col++)
            {
                bool muddy = board[row][col].type == TileType.Dirty;

                boardObj[row][col].GetComponent <Renderer>().enabled = muddy;
            }
        }

        //TESTING THE LEVEL LOADING
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            loadLevel(1);
        }
        if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            loadLevel(2);
        }
        if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            loadLevel(3);
        }
        if (Input.GetKeyDown(KeyCode.Alpha4))
        {
            loadLevel(4);
        }
    }