Exemplo n.º 1
0
 public Game(IGameConfigurator congigurator, IGameView view)
 {
     IsStarted += view.GameAction;
     IsMoveEnded += view.MoveAction;
     _robots = congigurator.GetRobots();
     _field = congigurator.GetField();
     foreach (var robot in _robots)
     {
         robot.MoveIsMaked += view.RobotAction;
     }
 }
Exemplo n.º 2
0
 public Game(IGameConfigurator congigurator, IGameView view)
 {
     IsStarted   += view.GameAction;
     IsMoveEnded += view.MoveAction;
     _robots      = congigurator.GetRobots();
     _field       = congigurator.GetField();
     foreach (var robot in _robots)
     {
         robot.MoveIsMaked += view.RobotAction;
     }
 }
Exemplo n.º 3
0
        public void GameInitialize(IGameConfigurator configurator)
        {
            GameDef     = configurator.GameDef;
            CurTeamTurn = GameTeam.White;

            foreach (var controlByTeam in configurator.ControlsByTeam)
            {
                var team    = controlByTeam.Key;
                var control = controlByTeam.Value;

                ControlsByTeam.Add(team, control);
            }
        }
Exemplo n.º 4
0
        public ConfigurationViewModel(IGameConfigurator gameConfigurator, IMapConfigurator mapConfigurator, INavigationService navigationService)
        {
            if (gameConfigurator == null)
                throw new ArgumentNullException(nameof(gameConfigurator));
            if (mapConfigurator == null)
                throw new ArgumentNullException(nameof(mapConfigurator));
            if (navigationService == null)
                throw new ArgumentNullException(nameof(navigationService));

            this.mapConfigurator = mapConfigurator;
            this.gameConfigurator = gameConfigurator;
            this.navigationService = navigationService;

            _createLobbyCommand = new RelayCommand(CreateLobby, () => CanCreateLobby);
        }
Exemplo n.º 5
0
 public void GameInitialize(IGameConfigurator configurator)
 {
     BoardTileCreator.OnCreated += OnCreatedHandler;
 }
Exemplo n.º 6
0
 public void CantBeConstructedWithNull(IGameConfigurator gameconfig, IMapConfigurator mapconfig, INavigationService navigation)
 {
     Assert.Throws<ArgumentNullException>(() => new ConfigurationViewModel(gameconfig, mapconfig, navigation));
 }
Exemplo n.º 7
0
 public void StartGame(IGameConfigurator gameConfigurator)
 {
     Array.ForEach(ComponentsInitializable, component => component.GameInitialize(gameConfigurator));
     Array.ForEach(ComponentsStarting, component => component.GameStarting());
 }
Exemplo n.º 8
0
 public void GameInitialize(IGameConfigurator configurator)
 {
     _isPause            = true;
     _boardTileGenerator = configurator.GameDef.BoardTileGenerator;
 }
Exemplo n.º 9
0
 public void GameInitialize(IGameConfigurator configurator)
 {
     LootModel.OnAddedEntity += OnAddedEntityHandler;
 }
Exemplo n.º 10
0
 public void StartGame(IGameConfiguratorData configuratorData)
 {
     _curConfigurator = GameConfiguratorCreator.Create(configuratorData);
     StartGame(_curConfigurator);
 }
Exemplo n.º 11
0
 public void GameInitialize(IGameConfigurator configurator)
 {
     _gameDef      = configurator.GameDef;
     PlayerBallDef = configurator.PlayerBallDef;
 }