Example #1
0
        public bool Resolve(KeyboardInputManger keyboardInputManger)
        {
            switch (State)
            {
            case KeyStates.Up:
                return(!keyboardInputManger.KeyPressed[Key]);

            case KeyStates.Down:
                return(keyboardInputManger.KeyPressed[Key]);

            case KeyStates.Clicked:
                return(keyboardInputManger.KeyClicked[Key]);
            }

            throw new NotImplementedException();
        }
Example #2
0
        public void Initialse(GraphicsDeviceManager graphics)
        {
            _mouseManger         = new MouseManger();
            _keyboardInputManger = new KeyboardInputManger();
            _componentManager    = new ComponentManager();
            _entityManager       = new EntityManager()
            {
                ComponentManager = _componentManager
            };
            _renderManager = new RenderManager()
            {
                ComponentManager = _componentManager
            };
            _inputManger    = new InputManger(_componentManager);
            _grid           = new Grid();
            _colssionManger = new ColssionComManger(_componentManager, _entityManager, _grid);
            _textureManager = new TextureManager
            {
                Content = Content
            };
            _fontManger = new FontManger
            {
                Content = Content
            };
            _soundManager = new SoundManager(Content, Settings);
            _senceManger  = new SenceManger(_entityManager);
            _stepManager  = new StepManager()
            {
                ComponentManager = _componentManager
            };
            _gameEvenetPostMaster = new GameEvenetPostMaster(_componentManager);
            _gameInfo             = new GameInfo(graphics);

            _minigameManger             = Utils.GetFromJsonFile <MinigameManger>(@"Minigames\MinigameList.json");
            _minigameManger.SenceManger = _senceManger;

            _entiyBlueprintManger = JsonConvert.DeserializeObject <BlueprintManger>
                                    (
                Utils.ReadEntireFile(@"Minigames\Blueprints.json"),
                Utils.JsonSettings
                                    );

            _gameObjectFactory = new GameObjectFactory
            {
                ComponentManager     = _componentManager,
                RenderManager        = _renderManager,
                EntityManager        = _entityManager,
                InputManger          = _inputManger,
                ColssionManger       = _colssionManger,
                StepManager          = _stepManager,
                TextureManager       = _textureManager,
                FontManger           = _fontManger,
                SoundManager         = _soundManager,
                MinigameManger       = _minigameManger,
                SpriteBatch          = SpriteBatch,
                SenceManger          = _senceManger,
                BlueprintManger      = _entiyBlueprintManger,
                MouseManger          = _mouseManger,
                KeyboardInputManger  = _keyboardInputManger,
                Content              = Content,
                GameEvenetPostMaster = _gameEvenetPostMaster,
                Grid     = _grid,
                GameInfo = _gameInfo
            };

            _senceManger.GameObjectFactory = _gameObjectFactory;
            _componentManager.PostMaster   = _gameEvenetPostMaster;

            SetupPlayer();
            SetupResoultion();
        }