예제 #1
0
        public UIController(InputModel inputModel, PointModel pointModel,
                            EnemyPool enemyPool, PauseModel pauseModel)
        {
            _controllers = new ControllerList();

            _pause = inputModel.Pause();
            _pause.OnKeyPressed += OnPauseKeyPressed;

            _pointModel = pointModel;
            _pointModel.OnPointsChanged += OnPointsChanged;

            _enemyPool = enemyPool;
            _enemyPool.OnEnemyKilledAndReturned += OnEnemyKilled;

            _lastEnemyKilledPanelController = new LastEnemyKilledPanelController();
            _scorePanelController           = new ScorePanelController();
            _pausePanelController           = new PausePanelController(pauseModel);
            _nullPanelController            = new NullPanelController();

            _controllers.Add(_pausePanelController);

            _scorePanelController.SetText("0");
            _pausePanelController.Close();
            _pausePanelController.OnResumeButtonPressed += ChangePanelController;

            _currentPanelController = _nullPanelController;

            _controllers.Initialize();
        }
예제 #2
0
        public void AddController(Controller controller)
        {
            Debug.Assert(!ControllerList.Contains(controller), "You are adding the same controller more than once.");

            controller.World = this;
            ControllerList.Add(controller);

            ControllerAdded?.Invoke(controller);
        }
예제 #3
0
        public virtual void AddController(IController model)
        {
            if (m_ControllerList == null)
            {
                m_ControllerList = new ControllerList();
            }

            m_ControllerList.Add(model);
        }
예제 #4
0
        private void ProcessAddedItems()
        {
            //Add any new geometries
            for (int i = 0; i < geomAddList.Count; i++)
            {
                if (!geomList.Contains(geomAddList[i]))
                {
                    geomAddList[i].isRemoved = false;
                    geomList.Add(geomAddList[i]);

                    //Add the new geometry to the broad phase collider.
                    _broadPhaseCollider.Add(geomAddList[i]);
                }
            }
            geomAddList.Clear();

            //Add any new bodies
            for (int i = 0; i < bodyAddList.Count; i++)
            {
                if (!bodyList.Contains(bodyAddList[i]))
                {
                    bodyList.Add(bodyAddList[i]);
                }
            }
            bodyAddList.Clear();

            //Add any new controllers
            for (int i = 0; i < controllerAddList.Count; i++)
            {
                if (!controllerList.Contains(controllerAddList[i]))
                {
                    controllerList.Add(controllerAddList[i]);
                }
            }
            controllerAddList.Clear();

            //Add any new joints
            for (int i = 0; i < jointAddList.Count; i++)
            {
                if (!jointList.Contains(jointAddList[i]))
                {
                    jointList.Add(jointAddList[i]);
                }
            }
            jointAddList.Clear();

            //Add any new springs
            for (int i = 0; i < springAddList.Count; i++)
            {
                if (!springList.Contains(springAddList[i]))
                {
                    springList.Add(springAddList[i]);
                }
            }
            springAddList.Clear();
        }
예제 #5
0
 public MoveableObject(string id,
                       ActorType actorType,
                       StatusType statusType,
                       Transform3D transform,
                       EffectParameters effectParameters,
                       Model model,
                       IController controller) :
     base(id, actorType, statusType, transform, effectParameters, model)
 {
     ControllerList.Add(controller);
 }
예제 #6
0
        public virtual void AddController(IController model)
        {
            Type type = model.GetType();

            if (m_ControllerList == null)
            {
                m_ControllerList = new ControllerList();
            }

            m_ControllerList.Add(model);
        }
예제 #7
0
 /// <summary>
 /// Creates a new profile with the given name.
 /// </summary>
 /// <param name="profileName">The name of the profile.</param>
 public MadCatzProfile(string profileName)
     : base()
 {
     name        = profileName;
     version     = CURRENT_VERSION;
     controllers = new ControllerList();
     Controller[] deviceGroups = Controller.CreateAllControllers();
     foreach (Controller deviceGroup in deviceGroups)
     {
         controllers.Add(deviceGroup);
     }
     commands = new CommandList();
     blasts   = new BlastList();
 }
예제 #8
0
        /// <summary>
        /// Processes the added geometries, springs, joints, bodies and controllers.
        /// </summary>
        private void ProcessAddedItems()
        {
            //Add any new geometries
            _tempCount = _geomAddList.Count;
            for (int i = 0; i < _tempCount; i++)
            {
                if (!GeomList.Contains(_geomAddList[i]))
                {
                    _geomAddList[i].InSimulation = true;
                    GeomList.Add(_geomAddList[i]);

                    //Add the new geometry to the broad phase collider.
                    _broadPhaseCollider.Add(_geomAddList[i]);
                }
            }
            _geomAddList.Clear();

            //Add any new bodies
            _tempCount = _bodyAddList.Count;
            for (int i = 0; i < _tempCount; i++)
            {
                if (!BodyList.Contains(_bodyAddList[i]))
                {
                    BodyList.Add(_bodyAddList[i]);
                }
            }
            _bodyAddList.Clear();

            //Add any new controllers
            _tempCount = _controllerAddList.Count;
            for (int i = 0; i < _tempCount; i++)
            {
                if (!ControllerList.Contains(_controllerAddList[i]))
                {
                    ControllerList.Add(_controllerAddList[i]);
                }
            }
            _controllerAddList.Clear();

            //Add any new joints
            _tempCount = _jointAddList.Count;
            for (int i = 0; i < _tempCount; i++)
            {
                if (!JointList.Contains(_jointAddList[i]))
                {
                    JointList.Add(_jointAddList[i]);
                }
            }
            _jointAddList.Clear();

            //Add any new springs
            _tempCount = _springAddList.Count;
            for (int i = 0; i < _tempCount; i++)
            {
                if (!SpringList.Contains(_springAddList[i]))
                {
                    SpringList.Add(_springAddList[i]);
                }
            }
            _springAddList.Clear();
        }
예제 #9
0
        //Body, wait for engine updates
        #endregion

        #region Constructors
        public MoveableObject(ModelObject modelObject, IController controller) :
            base(modelObject)
        {
            ControllerList.Add(controller);
        }