Ejemplo n.º 1
0
 public GamesController(IGameServices gameServices, IGenreServices genreServices, ICommentsServices commentsServices, IPlatformServices platformServices)
 {
     comments  = commentsServices;
     games     = gameServices;
     genres    = genreServices;
     platforms = platformServices;
 }
Ejemplo n.º 2
0
        private void Awake()
        {
            _dataProvider = MainInstaller.Resolve <IGameDataProvider>();
            _services     = MainInstaller.Resolve <IGameServices>();

            _timer.Init(_services);
        }
Ejemplo n.º 3
0
        public void Setup()
        {
            repo = new Mock <IRepository>();
            IOptions <GameSettings> options = _provider.GetService <IOptions <GameSettings> >();

            service      = new GameServices(repo.Object, options);
            gameSettings = options.Value;
        }
Ejemplo n.º 4
0
        public GameDeleteModel(
            IGameServices gameService,
            IStorageService storageService)
        {
            _gameService = gameService;

            _storageService = storageService;
        }
Ejemplo n.º 5
0
 public InitialLoadingState(IGameLogicInit gameLogic, IGameServices services, IGameUiServiceInit uiService,
                            IConfigsAdder configsAdder, IDataService dataService)
 {
     _gameLogic    = gameLogic;
     _services     = services;
     _uiService    = uiService;
     _configsAdder = configsAdder;
     _dataService  = dataService;
 }
Ejemplo n.º 6
0
        // AppLog is always first service added so other services can log initialization errors
        public static ServiceManager Instantiate(IAppLog appLog)
        {
            if (GameServices != null)
            {
                throw new System.Exception("Trying to instantiate ServiceManager more than once");
            }

            GameServices = new ServiceManager(appLog);
            return((ServiceManager)GameServices);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Initializes the view to start it's update loop.
        /// </summary>
        /// <exception cref="InvalidOperationException">
        /// Thrown if is called more than one time for the same entity GameObject
        /// </exception>
        public void Init(IGameServices services)
        {
            if (_services != null)
            {
                throw new InvalidOperationException("The Timer View was already initialized");
            }

            _services = services;

            _services.TickService.SubscribeOnUpdate(UpdateTime, 1, true, true);
        }
Ejemplo n.º 8
0
 public void AddService <T>(IGameServices service)
 {
     if (service is T)
     {
         _services.Add(typeof(T), service);
     }
     else
     {
         throw new Exception("Service " + service + " have not implemented interface ");
     }
 }
Ejemplo n.º 9
0
    public MatchSession(IGameServices services, int line, int column, Vector2 boardSize)
    {
        this.services = services;
        this.line     = line;
        this.column   = column;

        board = new Piece[line, column];

        behaviour = new MatchBehaviour(board, boardSize);
        behaviour.InitialPieces();
    }
Ejemplo n.º 10
0
        public void ShouldCreateDeck()
        {
            //Arrange
            _gameServices = new GameServices();

            //Act
            var deck = _gameServices.CreateDeck();

            //Assert
            Assert.IsNotNull(deck);
            Assert.IsNotNull(deck.Cards);
            Assert.AreEqual(deck.Cards.Count, _gameServices.GameSettings.NumberOfCards);
        }
Ejemplo n.º 11
0
 public GameCreateModel(
     IGameServices gameService,
     IStorageService storageService,
     ICategoryServices categoryService,
     IGenreServices genreService,
     IModeServices modeService,
     IPlatformServices platformService)
 {
     _gameService     = gameService;
     _storageService  = storageService;
     _categoryService = categoryService;
     _genreService    = genreService;
     _modeService     = modeService;
     _platformService = platformService;
 }
Ejemplo n.º 12
0
        public void ShouldShuffleDeck()
        {
            //Arrange
            _gameServices = new GameServices();

            //Act
            var deck         = _gameServices.CreateDeck();
            var card1        = deck.Cards[0];
            var shuffledDeck = _gameServices.ShuffleDeck(deck);
            var card2        = shuffledDeck.Cards[0];

            //Assert
            Assert.That(() => _gameServices.ShuffleDeck(null), Throws.ArgumentException);
            Assert.That(() => _gameServices.ShuffleDeck(new Deck()), Throws.ArgumentException);
            Assert.AreNotEqual(card1, card2);
        }
Ejemplo n.º 13
0
        public void ShouldCreateCardGame()
        {
            //Arrange
            _gameServices = new GameServices();

            //Act
            int specifiedRounds         = 3;
            var deck                    = _gameServices.CreateDeck();
            var shuffledDeck            = _gameServices.ShuffleDeck(deck);
            var game                    = _gameServices.CreateCardGame(2, shuffledDeck, null);
            var gameWithSpecifiedRounds = _gameServices.CreateCardGame(5, shuffledDeck, specifiedRounds);

            //Assert
            Assert.That(() => _gameServices.CreateCardGame(0, shuffledDeck, null), Throws.ArgumentException);
            Assert.That(() => _gameServices.CreateCardGame(1000, shuffledDeck, null), Throws.ArgumentException);
            Assert.That(() => _gameServices.CreateCardGame(2, null, null), Throws.ArgumentException);
            Assert.That(() => _gameServices.CreateCardGame(2, new Deck(), null), Throws.ArgumentException);
            Assert.IsNotNull(game);
            Assert.AreEqual(game.RoundsCount, _gameServices.GameSettings.NumberOfCards / game.PlayersCount);
            Assert.AreEqual(gameWithSpecifiedRounds.RoundsCount, specifiedRounds);
        }
Ejemplo n.º 14
0
 public GameHub(IGameServices gameServices) : base()
 {
     _gameServices = gameServices;
 }
 public LeaderboardController(IMemberServices memberServices, IGameServices gameServices) : base(memberServices, gameServices)
 {
 }
 public GameController(IHubContext <GameHub> hubContext)
 {
     _services   = new GameService();
     _hubContext = hubContext;
 }
Ejemplo n.º 17
0
 public GamesModel(IGameServices gameService)
 {
     _gameService = gameService;
 }
Ejemplo n.º 18
0
 private void Awake()
 {
     _services = MainInstaller.Resolve <IGameServices>();
 }
Ejemplo n.º 19
0
 public GameController(IGameServices gameServices)
 {
     _gameServices = gameServices;
 }
Ejemplo n.º 20
0
 public GameController(IGameServices gameService)
 {
     _gameService = gameService;
 }
Ejemplo n.º 21
0
 public GamesController(IGameServices services, IWebHostEnvironment hostingEnvironment)
 {
     _services           = services;
     _hostingEnvironment = hostingEnvironment;
 }
Ejemplo n.º 22
0
 public InterfacesController(IMemberServices memberServices, IGameServices gameServices) : base(memberServices, gameServices)
 {
 }
Ejemplo n.º 23
0
 public CRUD_GameMethods(IGameServices services)
 {
     _services = services;
 }
Ejemplo n.º 24
0
 public GamesApiController(ILogger <GamesApiController> logger, IGameServices gamesServices) : base(logger)
 {
     _logger        = logger;
     _gamesServices = gamesServices;
 }
Ejemplo n.º 25
0
 public GameController(IGameServices _gameServices)
 {
     gameService = _gameServices;
 }
Ejemplo n.º 26
0
 public GameDetailsModel(IGameServices gameService)
 {
     _gameService = gameService;
 }
Ejemplo n.º 27
0
 public GamesApplication(IGameServices gameService) : base()
     => this.gameService = gameService;
Ejemplo n.º 28
0
 public GameplayState(IGameServices services, IGameUiService uiService, Action <IStatechartEvent> statechartTrigger)
 {
     _services          = services;
     _uiService         = uiService;
     _statechartTrigger = statechartTrigger;
 }
Ejemplo n.º 29
0
 public CRUD_GameMethods()
 {
     _services = new GameServices();
 }
Ejemplo n.º 30
0
 public GamesController(IGameServices services)
 {
     _services = services;
 }