Ejemplo n.º 1
0
        /// <summary>
        /// Init the config for the quick game (2ep player options, and available zones)
        /// </summary>
        public void InitConfig()
        {
            BasicOfflineGameConfig = ConfigHelper.GetBasicConfig();
            var availableZones = ConfigHelper.GetAvailableZones();
            var zoneViewModel  = availableZones.ConvertAll(ZoneModelConverter.ConvertZone);

            ZoneViewModel.LoadImagesAsync(zoneViewModel);
            SingleMapConfig = new SingleMapConfig(zoneViewModel);
        }
        /// <summary>
        /// Init the config for the quick game (2ep player options, and available zones)
        /// </summary>
        public void InitConfig()
        {
            GameConfig = new BasicOnlineGameConfig();
            var availableZones = ConfigHelper.GetAvailableZones();
            var zoneViewModel  = availableZones.ConvertAll(ZoneModelConverter.ConvertZone);

            ZoneViewModel.LoadImagesAsync(zoneViewModel);
            SingleMapConfig   = new SingleMapConfig(zoneViewModel);
            MultipleMapConfig = new MultiMapConfig(zoneViewModel, new List <ZoneViewModel>());
        }
        public bool Validate()
        {
            if (string.IsNullOrWhiteSpace(GameConfig.GameName))
            {
                MessageHelper.ShowMessage("Woah minute!!!", "Un bal mémorable à besoin d'un nom approprié");
                return(false);
            }
            if (GameConfig.IsPrivate && string.IsNullOrWhiteSpace(GameConfig.Password))
            {
                MessageHelper.ShowMessage("Woah minute!!!", "Un bal privé, demande un mot de passe pour filtré les non-désirables");
                return(false);
            }
            if (GameConfig.ZoneConfig == ZoneConfig.SoloMap && !SingleMapConfig.Validate())
            {
                return(false);
            }
            if (GameConfig.ZoneConfig == ZoneConfig.MultiMap && !MultipleMapConfig.Validate())
            {
                return(false);
            }

            return(true);
        }