public void Validate() { LowerLayers = new List <string>(LowerLayers.Distinct()); MiddleLayers = new List <string>(MiddleLayers.Distinct()); UpperLayers = new List <string>(UpperLayers.Distinct()); var reservedLayers = new string[] { Attributes, Npcs, Lights, Events }; All.Clear(); All.AddRange(LowerLayers); All.AddRange(MiddleLayers); All.AddRange(UpperLayers); if (All.Count() == 0) { //Must have at least 1 map layer! throw new Exception("Config Error: You must have at least 1 map layer configured! Please update your server config."); } foreach (var reserved in reservedLayers) { if (All.Contains(reserved)) { throw new Exception($"Config Error: Layer '{reserved}' is reserved for editor use. Please choose different naming for map layers in your server config."); } } if (All.Count != All.Distinct().Count()) { //Duplicate layers! throw new Exception("Config Error: Duplicate map layers detected! Map layers must be unique in name. Please update your server config."); } }
public EditionDatabaseInfoModificationViewModel() { All.AddRange(MagicDatabase.GetAllEditionsOrdered()); ResetBlockCommand = new RelayCommand(ResetBlockExecute, ResetBlockCanExecute); Blocks = MagicDatabase.GetAllBlocks().ToArray(); Title = "Manage Edition"; }
public TranslateDatabaseInfoModificationViewModel() { AllTranslations = new ObservableCollection <TranslationViewModel>(); All.AddRange(MagicDatabase.GetAllInfos().GetAllCardsOrderByTranslation(null).Select(kv => kv.Value)); _notUpdatableLanguages = new[] { MagicDatabase.GetDefaultLanguage(), MagicDatabase.GetEnglishLanguage() }; _allLanguages = MagicDatabase.GetAllLanguages().Where(l => !_notUpdatableLanguages.Contains(l)).ToArray(); Title = "Manage Translate"; }
static OldCommands() { All.AddRange(Mode1.Commands); All.AddRange(Mode2.Commands); All.AddRange(Mode3.Commands); All.AddRange(Mode4.Commands); All.AddRange(Mode7.Commands); All.AddRange(Misc.Commands); }
public ColorPaletteCollection(ILogger <ColorPaletteCollection> logger) { try { All.AddRange(new[] { Default, Brendan, Tsuna, Strife }); } catch (Exception ex) { logger.LogError($"Error Initializing {nameof(ColorPaletteCollection)}", ex); } }
protected override bool ApplyEditionToDatabase() { if (Selected == null) { return(false); } MagicDatabase.UpdateEdition(Selected, GathererName, Name, HasFoil, Code, Block == null ? (int?)null : Block.Id, BlockPosition, CardNumber, ReleaseDate); All.Clear(); All.AddRange(MagicDatabase.GetAllEditionsOrdered()); return(true); }
public override void OnBeAddedToData() { base.OnBeAddedToData(); LastNameKeys.Clear(); LastNameKeys = BaseLanguageMgr.GetCategory(Last); All.Clear(); All.AddRange(Male.NameKeys); All.AddRange(Female.NameKeys); All.AddRange(LastNameKeys); Male.Parse(); Female.Parse(); }
private static void RefreshConfigs() { var list = Helper.Call(s => s.EntityGetList(new EntityRequest())); if (list?.Success ?? false) { Helper.InvokeMainThread(() => { All.Clear(); All.AddRange(list.ResultList.Select(e => Mapper.Map(e, new EntityModel()))); }); } }
protected override bool ApplyEditionToDatabase() { if (Selected == null) { MagicDatabase.InsertNewLanguage(Name, AlternativeName); } else { MagicDatabase.UpdateLanguage(Selected, Name, AlternativeName); } All.Clear(); All.AddRange(MagicDatabase.GetAllLanguages()); return(true); }
protected override bool ApplyEditionToDatabase() { if (Selected == null) { MagicDatabase.InsertNewBlock(Name); } else { MagicDatabase.UpdateBlock(Selected, Name); } All.Clear(); All.AddRange(MagicDatabase.GetAllBlocks()); return(true); }
public RootDefinitonsProvider Init(YamlyAssembliesProvider assemblies) { All.AddRange(GetRootDefinitions(assemblies.All.Except(assemblies.IgnoreAssemblies))); var validAssemblies = assemblies.All .Except(assemblies.IgnoreAssemblies) .Except(new[] { assemblies.MainRuntimeAssembly, assemblies.MainEditorAssembly, assemblies.ProxyAssembly }).ToList(); Valid.AddRange(All.Where(d => validAssemblies.Contains(d.Root.Assembly))); return(this); }
public LanguageDatabaseInfoModificationViewModel() { All.AddRange(MagicDatabase.GetAllLanguages()); Title = "Manage Language"; }
public BlockDatabaseInfoModificationViewModel() { All.AddRange(MagicDatabase.GetAllBlocks()); Title = "Manage Block"; }