Exemplo n.º 1
0
        internal override void AfterLoad(World world)
        {
            base.AfterLoad(world);

            _artifactSearch       = new ArtifactsList(World);
            _writtenContentSearch = new WrittenContentList(World);
            _danceFormSearch      = new DanceFormsList(World);
            _musicalFormSearch    = new MusicalFormsList(World);
            _poeticFormSearch     = new PoeticFormsList(World);

            var writtencontents = from writtenContent in World.WrittenContents
                                  orderby writtenContent.Type.GetDescription()
                                  group writtenContent by writtenContent.Type.GetDescription() into writtenContentType
                                  select writtenContentType;

            var artifactTypes = World.Artifacts.Select(x => x.Type).SkipWhile(string.IsNullOrEmpty).Distinct().OrderBy(x => x);

            var artifactMaterials = World.Artifacts.Select(x => string.IsNullOrEmpty(x.Material) ? "" : x.Material).SkipWhile(string.IsNullOrEmpty).Distinct().OrderBy(x => x);

            cmbWrittenContentType.Items.Add("All"); cmbWrittenContentType.SelectedIndex = 0;
            foreach (var writtencontent in writtencontents)
            {
                cmbWrittenContentType.Items.Add(writtencontent.Key);
            }

            cbmArtTypeFilter.Items.Add("All"); cbmArtTypeFilter.SelectedIndex = 0;
            cbmArtTypeFilter.Items.AddRange(artifactTypes.ToArray());
            lblArtTypeFilter.Visible = cbmArtTypeFilter.Visible = artifactTypes.Any();

            cbmArtMatFilter.Items.Add("All"); cbmArtMatFilter.SelectedIndex = 0;
            cbmArtMatFilter.Items.AddRange(artifactMaterials.ToArray());
            lblArtMatFilter.Visible = cbmArtMatFilter.Visible = artifactMaterials.Any();


            var artifactEvents = from eventType in World.Artifacts.SelectMany(artifact => artifact.Events)
                                 group eventType by eventType.Type into type
                                 select type.Key;

            var writtenContentEvents = from eventType in World.WrittenContents.SelectMany(element => element.Events)
                                       group eventType by eventType.Type into type
                                       select type.Key;

            var danceFormEvents = from eventType in World.DanceForms.SelectMany(element => element.Events)
                                  group eventType by eventType.Type into type
                                  select type.Key;
            var musicalFormEvents = from eventType in World.MusicalForms.SelectMany(element => element.Events)
                                    group eventType by eventType.Type into type
                                    select type.Key;
            var poeticFormEvents = from eventType in World.PoeticForms.SelectMany(element => element.Events)
                                   group eventType by eventType.Type into type
                                   select type.Key;

            TabEvents.Clear();
            TabEvents.Add(artifactEvents.ToList());
            TabEvents.Add(writtenContentEvents.ToList());
            TabEvents.Add(danceFormEvents.ToList());
            TabEvents.Add(musicalFormEvents.ToList());
            TabEvents.Add(poeticFormEvents.ToList());
        }
Exemplo n.º 2
0
        internal override void AfterLoad(World world)
        {
            base.AfterLoad(world);
            _regionSearch        = new RegionsList(World);
            _uRegionSearch       = new UndergroundRegionsList(World);
            _landmassSearch      = new LandmassesList(World);
            _mountainPeaksSearch = new MountainPeaksList(World);
            _riverSearch         = new RiverList(World);

            var regions = from region in World.Regions
                          orderby region.Type
                          group region by region.Type into regiontype
                          select regiontype;
            var uregions = from uregion in World.UndergroundRegions
                           orderby uregion.Type
                           group uregion by uregion.Type into uregiontype
                           select uregiontype;

            cmbRegionType.Items.Add("All"); cmbRegionType.SelectedIndex = 0;
            foreach (var region in regions)
            {
                cmbRegionType.Items.Add(region.Key);
            }

            cmbURegionType.Items.Add("All"); cmbURegionType.SelectedIndex = 0;
            foreach (var uregion in uregions)
            {
                cmbURegionType.Items.Add(uregion.Key);
            }

            var regionEvents = from eventType in World.Regions.SelectMany(region => region.Events)
                               group eventType by eventType.Type into type
                               select type.Key;
            var undergroundRegionEvents = from eventType in World.UndergroundRegions.SelectMany(uRegion => uRegion.Events)
                                          group eventType by eventType.Type into type
                                          select type.Key;
            var landmassEvents = from eventType in World.Landmasses.SelectMany(element => element.Events)
                                 group eventType by eventType.Type into type
                                 select type.Key;

            var mountainPeakEvents = from eventType in World.MountainPeaks.SelectMany(element => element.Events)
                                     group eventType by eventType.Type into type
                                     select type.Key;

            var riverEvents = from eventType in World.Rivers.SelectMany(element => element.Events)
                              group eventType by eventType.Type into type
                              select type.Key;

            TabEvents.Clear();
            TabEvents.Add(regionEvents.ToList());
            TabEvents.Add(undergroundRegionEvents.ToList());
            TabEvents.Add(landmassEvents.ToList());
            TabEvents.Add(mountainPeakEvents.ToList());
            TabEvents.Add(riverEvents.ToList());
        }
        ///-------------------------------------------------------------------------------------------------
        /// <summary>Loads the properties.</summary>
        ///
        /// <remarks>Gino Canessa, 1/16/2020.</remarks>
        ///-------------------------------------------------------------------------------------------------

        public static void LoadProps()
        {
            TabBindings.PropertyAttributesDict = TabBindings.GetPropsDict <TabBindings>();
            TabCodeList.PropertyAttributesDict = TabCodeList.GetPropsDict <TabCodeList>();
            TabDataElements.GetPropsDict <TabDataElements>();
            TabEvents.GetPropsDict <TabEvents>();
            TabExamples.GetPropsDict <TabExamples>();
            TabExtensions.GetPropsDict <TabExtensions>();
            TabInvariants.GetPropsDict <TabInvariants>();
            TabMetadata.GetPropsDict <TabMetadata>();
            TabOperations.GetPropsDict <TabOperations>();
            TabPackages.GetPropsDict <TabPackages>();
            TabSearch.GetPropsDict <TabSearch>();
            TabStructures.GetPropsDict <TabStructures>();
        }
Exemplo n.º 4
0
        internal override void AfterLoad(World world)
        {
            base.AfterLoad(world);
            _entitySearch = new EntitiesList(World);

            var civRaces = from civ in World.Entities.Where(entity => !string.IsNullOrWhiteSpace(entity.Name))
                           orderby civ.Race.NamePlural
                           group civ by civ.Race into civRace
                           select civRace;
            var populationTypes = from population in World.SitePopulations
                                  orderby population.Race.NamePlural
                                  group population by population.Race into type
                                  select type;
            var civPopulationTypes = from civPopulation in populationTypes
                                     where World.Entities.Count(entity => entity.Populations.Count(population => population.Race == civPopulation.Key) > 0) > 0
                                     select civPopulation;
            var entites = from entity in world.Entities
                          orderby entity.Type.GetDescription()
                          group entity by entity.Type.GetDescription() into entityType
                          select entityType;

            cmbCivRace.Items.Add("All"); cmbCivRace.SelectedIndex = 0;
            foreach (var civRace in civRaces)
            {
                cmbCivRace.Items.Add(civRace.Key.NamePlural);
            }

            cmbEntityPopulation.Items.Add("All"); cmbEntityPopulation.SelectedIndex = 0;
            foreach (var civPopulation in civPopulationTypes)
            {
                cmbEntityPopulation.Items.Add(civPopulation.Key.NamePlural);
            }

            cmbEntityType.Items.Add("All"); cmbEntityType.SelectedIndex = 0;
            foreach (var entity in entites)
            {
                cmbEntityType.Items.Add(entity.Key);
            }

            var entityEvents = from eventType in World.Entities.SelectMany(hf => hf.Events)
                               group eventType by eventType.Type into type
                               select type.Key;

            TabEvents.Clear();
            TabEvents.Add(entityEvents.ToList());
        }
Exemplo n.º 5
0
        internal override void AfterLoad(World world)
        {
            base.AfterLoad(world);
            _hfSearch = new HistoricalFigureList(World);

            var races = from hf in World.HistoricalFigures
                        orderby hf.Race
                        group hf by hf.Race into race
                        select race;
            var castes = from hf in World.HistoricalFigures
                         orderby hf.Caste
                         group hf by hf.Caste into caste
                         select caste;
            var types = from hf in World.HistoricalFigures
                        orderby hf.AssociatedType
                        group hf by hf.AssociatedType into type
                        select type;

            cmbRace.Items.Add("All"); cmbRace.SelectedIndex = 0;
            foreach (var race in races)
            {
                cmbRace.Items.Add(race.Key);
            }

            cmbCaste.Items.Add("All"); cmbCaste.SelectedIndex = 0;
            foreach (var caste in castes)
            {
                cmbCaste.Items.Add(caste.Key);
            }

            cmbType.Items.Add("All"); cmbType.SelectedIndex = 0;
            foreach (var type in types)
            {
                cmbType.Items.Add(type.Key);
            }

            TabEvents.Clear();

            var historicalFigureEvents = from eventType in World.HistoricalFigures.SelectMany(hf => hf.Events)
                                         group eventType by eventType.Type into type
                                         select type.Key;

            TabEvents.Add(historicalFigureEvents.ToList());
        }
Exemplo n.º 6
0
        internal override void AfterLoad(World world)
        {
            base.AfterLoad(world);
            _warSearch         = new WarsList(World);
            _battleSearch      = new BattlesList(World);
            _conqueringsSearch = new ConqueringsList(World);
            _beastAttackSearch = new BeastAttackList(World);
            _raidsSearch       = new RaidsList(World);

            var conquerTypes = from conquer in World.EventCollections.OfType <SiteConquered>()
                               orderby conquer.ConquerType
                               group conquer by conquer.ConquerType into conquers
                               select conquers;

            cmbConqueringType.Items.Add("All"); cmbConqueringType.SelectedIndex = 0;
            foreach (var conquerType in conquerTypes)
            {
                cmbConqueringType.Items.Add(conquerType.Key);
            }

            var warEvents = from eventType in World.EventCollections.OfType <War>().SelectMany(war => war.GetSubEvents())
                            group eventType by eventType.Type into type
                            select type.Key;
            var battleEvents = from eventType in World.EventCollections.OfType <Battle>().SelectMany(battle => battle.GetSubEvents())
                               group eventType by eventType.Type into type
                               select type.Key;
            var conqueringEvents = from eventType in World.EventCollections.OfType <SiteConquered>().SelectMany(conquering => conquering.GetSubEvents())
                                   group eventType by eventType.Type into type
                                   select type.Key;
            var beastAttackEvents = from eventType in World.EventCollections.OfType <BeastAttack>().SelectMany(beastAttack => beastAttack.GetSubEvents())
                                    group eventType by eventType.Type into type
                                    select type.Key;
            var raidEvents = from eventType in World.EventCollections.OfType <Raid>().SelectMany(raid => raid.GetSubEvents())
                             group eventType by eventType.Type into type
                             select type.Key;

            TabEvents.Clear();
            TabEvents.Add(warEvents.ToList());
            TabEvents.Add(battleEvents.ToList());
            TabEvents.Add(conqueringEvents.ToList());
            TabEvents.Add(beastAttackEvents.ToList());
            TabEvents.Add(raidEvents.ToList());
        }
Exemplo n.º 7
0
        internal override void AfterLoad(World world)
        {
            base.AfterLoad(world);


            listEraSearch.SetObjects(World.Eras.ToArray());

            numStart.Maximum = numEraEnd.Value = numEraEnd.Maximum = World.Events.Last().Year;

            Coordinator.Form.DontRefreshBrowserPages = true;
            foreach (CheckBox eraCheck in tpEraEvents.Controls.OfType <CheckBox>())
            {
                eraCheck.Checked = false;
            }

            Coordinator.Form.DontRefreshBrowserPages = false;

            var eventTypes = from eventType in World.Events
                             group eventType by eventType.Type into type
                             select type.Key;

            TabEvents.Clear();
            TabEvents.Add(eventTypes.ToList());
        }
Exemplo n.º 8
0
        internal override void AfterLoad(World world)
        {
            base.AfterLoad(world);

            _worldConstructionSearch = new WorldConstructionsList(World);
            _structureSearch         = new StructuresList(World);

            var structures = from structure in World.Structures
                             orderby structure.Type.GetDescription()
                             group structure by structure.Type.GetDescription() into structuretype
                             select structuretype;

            var worldconstructions = from construction in World.WorldConstructions
                                     orderby construction.Type.GetDescription()
                                     group construction by construction.Type.GetDescription() into constructiontype
                                     select constructiontype;

            cmbStructureType.Items.Add("All"); cmbStructureType.SelectedIndex = 0;
            foreach (var structure in structures)
            {
                cmbStructureType.Items.Add(structure.Key);
            }

            cmbConstructionType.Items.Add("All"); cmbConstructionType.SelectedIndex = 0;
            foreach (var construction in worldconstructions)
            {
                cmbConstructionType.Items.Add(construction.Key);
            }

            var worldConstructionEvents = from eventType in World.WorldConstructions.SelectMany(element => element.Events)
                                          group eventType by eventType.Type into type
                                          select type.Key;

            var structureEvents = from eventType in World.Structures.SelectMany(element => element.Events)
                                  group eventType by eventType.Type into type
                                  select type.Key;

            _siteSearch = new SitesList(World);

            var sites = from site in World.Sites
                        where !string.IsNullOrWhiteSpace(site.Name)
                        orderby site.Type
                        group site by site.Type into sitetype
                        select sitetype;

            var populationTypes = from population in World.SitePopulations
                                  orderby population.Race
                                  group population by population.Race into type
                                  select type;

            cmbSiteType.Items.Add("All");
            cmbSiteType.SelectedIndex = 0;

            foreach (var site in sites)
            {
                cmbSiteType.Items.Add(site.Key);
            }

            cmbSitePopulation.Items.Add("All"); cmbSitePopulation.SelectedIndex = 0;
            foreach (var populationType in populationTypes)
            {
                cmbSitePopulation.Items.Add(populationType.Key);
            }

            var siteEvents = from eventType in World.Sites.SelectMany(site => site.Events)
                             group eventType by eventType.Type into type
                             select type.Key;

            TabEvents.Clear();
            TabEvents.Add(siteEvents.ToList());
            TabEvents.Add(structureEvents.ToList());
            TabEvents.Add(worldConstructionEvents.ToList());
        }