Пример #1
0
        public void SwitchAction(ISpecialAction oldAction, ISpecialAction newAction)
        {
            WindowController c = windows.Find(w => w.Controller.Action == oldAction);

            c.Controller = new ActionControllerImpl(mgr, newAction);
            c.Window.AttachNewController(c.Controller);

            actions.Remove(oldAction);
            actions.Add(newAction);
        }
Пример #2
0
        public void Update(float tpf)
        {
            mgr.GetCurrentPlayer().ShowGold();
            actions.ForEach(action => action.Update(tpf));

            for (int i = 0; i < windows.Count; ++i)
            {
                WindowController windowController = windows[i];
                windowController.Controller.Update(windowController.Window, tpf);
                if (windowController.Controller.Action.IsReady())
                {
                    windowController.Window.Activate();
                }
                else
                {
                    windowController.Window.Deactivate();
                }
            }
        }