Beispiel #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;
     }
 }
Beispiel #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;
     }
 }
Beispiel #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);
            }
        }
Beispiel #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);
        }
 public void GameInitialize(IGameConfigurator configurator)
 {
     BoardTileCreator.OnCreated += OnCreatedHandler;
 }
 public void CantBeConstructedWithNull(IGameConfigurator gameconfig, IMapConfigurator mapconfig, INavigationService navigation)
 {
     Assert.Throws<ArgumentNullException>(() => new ConfigurationViewModel(gameconfig, mapconfig, navigation));
 }
Beispiel #7
0
 public void StartGame(IGameConfigurator gameConfigurator)
 {
     Array.ForEach(ComponentsInitializable, component => component.GameInitialize(gameConfigurator));
     Array.ForEach(ComponentsStarting, component => component.GameStarting());
 }
Beispiel #8
0
 public void GameInitialize(IGameConfigurator configurator)
 {
     _isPause            = true;
     _boardTileGenerator = configurator.GameDef.BoardTileGenerator;
 }
Beispiel #9
0
 public void GameInitialize(IGameConfigurator configurator)
 {
     LootModel.OnAddedEntity += OnAddedEntityHandler;
 }
Beispiel #10
0
 public void StartGame(IGameConfiguratorData configuratorData)
 {
     _curConfigurator = GameConfiguratorCreator.Create(configuratorData);
     StartGame(_curConfigurator);
 }
Beispiel #11
0
 public void GameInitialize(IGameConfigurator configurator)
 {
     _gameDef      = configurator.GameDef;
     PlayerBallDef = configurator.PlayerBallDef;
 }