Exemple #1
0
 public GameService(IHubContext <GameHub> context, IPlayerService playerService, IGameLogicService gameLogicService, IMapper mapper, TypeAdapterConfig typeAdapterConfig) : base(context)
 {
     _context           = context;
     _playerService     = playerService;
     _gameLogicService  = gameLogicService;
     _mapper            = mapper;
     _typeAdapterConfig = typeAdapterConfig;
     _games             = new ConcurrentDictionary <string, Game>();
 }
Exemple #2
0
 public ScoreBoard(Menu menu, Texture2D texture, SpriteFont font, Color color, Color focusCol)
 {
     // WorldData2D gameWorld = (WorldData2D)Game.Services.GetService(typeof(WorldData2D));
     this.menu       = menu;
     this.font       = font;
     this.color      = color;
     this.focusColor = focusCol;
     this.texture    = texture;
     gameLogic       = menu.Game.Services.GetService(typeof(IGameLogicService)) as IGameLogicService;
     this.title      = "Top Scores";
 }
Exemple #3
0
        public override void Initialize()
        {
            System.Console.WriteLine("Menu:Initialize");
            this.traverser                    = new MenuTraverser(this.root);
            menuInputController               = Game.Services.GetService(typeof(IMenuInputService)) as IMenuInputService;
            menuInputController.menuAction   += this.traverser.OnMenuAction;
            menuInputController.cursorAction += this.traverser.onCursorAction;
            menuInputController.kinectAction += this.traverser.onKinectAction;
            menuInputController.start();

            this.gameLogic = Game.Services.GetService(typeof(IGameLogicService)) as IGameLogicService;
            this.renderer  = Game.Services.GetService(typeof(IRendering3DService)) as IRendering3DService;
            base.Initialize();
            spriteBatch = new SpriteBatch(GraphicsDevice);
        }
Exemple #4
0
        public override void Initialize()
        {
            IGameLogicService gameLogic = Game.Services.GetService(typeof(IGameLogicService)) as IGameLogicService;

            this.exit.actionPerformed   += gameLogic.OnBackToMenu;
            this.resume.actionPerformed += gameLogic.OnResumeGame;
            this.save.actionPerformed   += gameLogic.OnSaveGame;

            base.Initialize();

            this.menuInputController = Game.Services.GetService(typeof(IMenuInputService)) as IMenuInputService;

            menuInputController.cursorAction += this.traverser.onCursorAction;
            menuInputController.kinectAction += this.traverser.onKinectAction;
            menuInputController.menuAction   += this.traverser.OnMenuAction;//(MenuTraverser.Actions action) => this.traverser.OnMenuAction(action); ;
            menuInputController.start();
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //Game.Components.Add(new MenuInputController(this.game));
        }
Exemple #5
0
        protected override void Dispose(bool disposing)
        {
            IMenuInputService menuInputController = Game.Services.GetService(typeof(IMenuInputService)) as IMenuInputService;

            if (menuInputController != null)
            {
                menuInputController.menuAction   -= this.traverser.OnMenuAction;
                menuInputController.cursorAction -= this.traverser.onCursorAction;
                menuInputController.kinectAction -= this.traverser.onKinectAction;
                menuInputController.pause();
            }
            IGameLogicService gameLogic = Game.Services.GetService(typeof(IGameLogicService)) as IGameLogicService;

            if (gameLogic != null)
            {
                this.exit.actionPerformed   -= gameLogic.OnBackToMenu;
                this.resume.actionPerformed -= gameLogic.OnResumeGame;
                this.save.actionPerformed   -= gameLogic.OnSaveGame;
            }
            Game.Services.RemoveService(typeof(IGameMenuService));
            base.Dispose(disposing);
        }
Exemple #6
0
 public GameLogicController(IGameLogicService gameLogicService)
 {
     _GameLogicService = gameLogicService;
 }
Exemple #7
0
 public GameLogicController(IGameLogicService logicService)
 {
     _gameLogicService = new GameLogicService();
 }
Exemple #8
0
 public GameAPIController(IGameLogicService gameLogicService)
 {
     _gameLogicService = gameLogicService;
 }