Exemplo n.º 1
0
        private Arena BuildArena(ArenaViewModel arenaViewModel)
        {
            var arena = new Arena(arenaViewModel.Type, arenaViewModel.Name, arenaViewModel.IsNewGamesArena);

            foreach (var layoutViewModel in arenaViewModel.Layouts)
            {
                var layout = new ArenaLayout(layoutViewModel.PlayerStatus.Id, layoutViewModel.Attributes);

                layout.DataGridInfo = layoutViewModel.DataGridInfo;

                foreach (var filterViewModel in layoutViewModel.Filters)
                {
                    layout.FilteringInfo.Add(new Filter(filterViewModel.Label, filterViewModel.Name, filterViewModel.Attributes));
                }

                foreach (var alsoPlayGameViewModel in layoutViewModel.AlsoPlayingGames)
                {
                    layout.AlsoPlayingGames.Add(new Game(alsoPlayGameViewModel.GameType, alsoPlayGameViewModel.Name));
                }

                foreach (var gameViewModel in layoutViewModel.Games.Select(g => g.ConvertToAvailableGame()))
                {
                    layout.Games.Add(gameViewModel.BuildArenaGame());
                }

                arena.Layouts.Add(layout);
            }

            return(arena);
        }
Exemplo n.º 2
0
        private void LoadArenas(ArenaCollection arenas)
        {
            _skinDefinition.Arenas = new ArenaCollectionViewModel(_serviceLocator);
            foreach (var arena in arenas)
            {
                var arenaViewModel = new ArenaViewModel(arena.Type, arena.Name, arena.IsNewGameArena, _skinDefinition.Triggers, _serviceLocator);

                LoadArenaLayouts(arena, arenaViewModel);

                _skinDefinition.Arenas.Add(arenaViewModel);
            }
        }
Exemplo n.º 3
0
        private void LoadArenaLayouts(Arena arena, ArenaViewModel arenaViewModel)
        {
            foreach (var arenaLayout in arena.Layouts)
            {
                var arenaLayoutViewModel = new ArenaLayoutViewModel(arenaViewModel,
                                                                    new PlayerStatusTypeViewModel(PlayerStatusType.FromId(arenaLayout.PlayerStatus), _skinDefinition.Triggers),
                                                                    arenaLayout.Attributes,
                                                                    arenaLayout.DataGridInfo);

                LoadArenaLayoutAlsoPlayingGames(arenaViewModel.Name, arenaLayoutViewModel, arenaLayout.AlsoPlayingGames);
                LoadArenaLayoutFilters(arenaLayoutViewModel, arenaLayout.FilteringInfo);
                LoadArenaLayoutGames(arenaViewModel.Name, arenaLayoutViewModel, arenaLayout.Games, arenaViewModel.IsNewGamesArena);

                arenaViewModel.Layouts.Add(arenaLayoutViewModel);
            }

            if (arenaViewModel.Layouts.Count > 0)
            {
                arenaViewModel.Layouts[0].Activate();
            }
        }
Exemplo n.º 4
0
 private void NavigateToArena(ArenaViewModel arena, ArenaLayoutViewModel arenaLayout, ArenaGameViewModel game)
 {
     arena.NavigateTo(arenaLayout, game);
 }
Exemplo n.º 5
0
 private void NavigateToArena(ArenaViewModel arena, ArenaLayoutViewModel arenaLayout)
 {
     NavigateToArena(arena, arenaLayout, null);
 }