Exemplo n.º 1
0
 public AIState(CameraSystem camera, GameArea gameArea)
     : base(camera, gameArea)
 {
     _allowedInputs = new Type[] { typeof(Zoom), typeof(MoveCameraTagetLocation),
     typeof(SelectPrevNextObject), typeof(Click) , typeof(SelectPrevNextObject),
     typeof(MouseDownAction),typeof(MouseUpAction), typeof(MouseMoveAction), typeof(EndTurn)};
 }
Exemplo n.º 2
0
        public BaseState(CameraSystem camera, GameArea gameArea)
        {
            _inputSystem = new InputSystem();
            _inputSystem.DoAction += new DoAction(InputManager_DoAction);

            _objectSystem = ObjectSystem.GetInstance();
            _cameraSystem = camera;
            _gameArea = gameArea;
        }
Exemplo n.º 3
0
        public Game(IView view)
        {
            _view = view;

            GameArea gameArea = new GameArea((int)view.GameViewSize.Width, (int)view.GameViewSize.Height, 6, 24);
            CameraSystem camera = new CameraSystem(view.GameViewSize, gameArea.GameAreaSize);
            _stateManager = new StateManager(gameArea, camera);

            _upTime = new Stopwatch();
        }
Exemplo n.º 4
0
        public StateManager(GameArea gameArea, CameraSystem camera)
        {
            BaseState.EndState += new ChangeState(state_EndState);
            BaseState.PauseState += new ChangeState(state_PauseState);

            _initState = new InitState(camera, gameArea);
            _rtState = new RealTimeState(camera, gameArea);
            _pauseState = new PauseState(camera, gameArea);
            _endState = new EndState(camera, gameArea);

            _current = _initState;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            this.IsMouseVisible = true;

            int width = graphics.PreferredBackBufferWidth;
            int height = graphics.PreferredBackBufferHeight;

            GameArea gameArea = new GameArea(width, height, 6, 24);
            CameraSystem camera = new CameraSystem(new Size(width, height), gameArea.GameAreaSize);

            _stateManager = new StateManager(gameArea, camera);

            base.Initialize();
        }
Exemplo n.º 6
0
 public InitState(CameraSystem camera, GameArea gameArea)
     : base(camera, gameArea)
 {
     _allowedInputs = new Type[] { typeof(EndTurn) };
 }