示例#1
0
        /// <summary>
        /// A list of persons for test purposes
        /// </summary>
        /// <param name="itemLinkFactory"></param>
        /// <returns></returns>
        public static List <MemoryItem> CreateOccupationsAndEventsForTest(IItemLinkFactory itemLinkFactory)
        {
            var items = new List <MemoryItem>();

            Place      Kaedwen       = new Place("Kaedwen", Guid.NewGuid());
            Occupation mason         = new Occupation("Mason", OccupationType.Contractor, Guid.NewGuid());
            Occupation king          = new Occupation("King", OccupationType.Political, Guid.NewGuid());
            PastEvent  savingTheKing = new PastEvent("The king was saved!", Guid.NewGuid())
            {
                Type = PastEventType.Life
            };

            items.Add(Kaedwen);
            items.Add(mason);
            items.Add(king);
            items.Add(savingTheKing);

            itemLinkFactory.CreateOccurenceBetweenEventAndPlace(savingTheKing, Kaedwen, OccurenceType.HappenedIn);
            itemLinkFactory.CreateInvolvementBetweenOccupationAndEvent(mason, savingTheKing, OccupationalInvolvementType.ParticipatedIn);
            itemLinkFactory.CreateInvolvementBetweenOccupationAndEvent(king, savingTheKing, OccupationalInvolvementType.WasCaughtIn);

            return(items);
        }
示例#2
0
        /// <summary>
        /// This method will return a full list of intialized and linked items of each category. For test purposes.
        /// </summary>
        /// <param name="itemLinkFactory">The factory that creates linked items</param>
        /// <returns>A list of all item types.</returns>
        public static List <MemoryItem> CreateItemsAndLinkThem(IItemLinkFactory itemLinkFactory)
        {
            //Organizations
            var witchers = new Organization("The Order of Witchers", OrganizationType.Trade, Guid.NewGuid(), WitcherDesc)
            {
                Started = new CustomDateTime(1031)
            };
            var governmentOfNilfgaard = new Organization("The Kingdom of Nilfgaard", OrganizationType.Government, Guid.NewGuid());
            var EmperorOfNilfgaard    = new Occupation("Imperator", OccupationType.Political, Guid.NewGuid(), "A shadowy figure");

            var governmentOfCintra = new Organization("The Kingdom of Cintra", OrganizationType.Government, Guid.NewGuid());

            var organizations = new List <Organization> {
                witchers, governmentOfNilfgaard, governmentOfCintra
            };

            //Occupations
            //Geralt of Rivia, witcher.
            var GeraltOfRivia = new Person("Geralt of Rivia", Gender.Male, Sex.Male, Orientation.Straight, Guid.NewGuid(), GeraltDesc);

            var witcherGeralt = new Occupation("Witcher", GeraltOfRivia, OccupationType.Independant, Guid.NewGuid(), WitcherDesc)
            {
                Started = new CustomDateTime(1031)
            };

            GeraltOfRivia.AddOccupation(witcherGeralt);

            List <MemoryItem>     linkObjects         = new List <MemoryItem>();
            List <MemoryItemLink> intermediateObjects = new List <MemoryItemLink>();

            var association1 = itemLinkFactory.CreateAssociationBetweenPersonAndOrganization(GeraltOfRivia, witchers, AssociationType.Member);

            linkObjects.Add(association1);

            //Foltest, king of Temeria
            var Foltest = new Person("Foltest", Guid.NewGuid(), FoltestDesc)
            {
                Gender = Gender.Male,
                Sex    = Sex.Male
            };

            Occupation kingOfTemeria = new Occupation("King of Temeria", Foltest, OccupationType.Political, Guid.NewGuid());

            Foltest.AddOccupation(kingOfTemeria);

            Person     Meve  = new Person("Meve", Guid.NewGuid());
            Occupation queen = new Occupation("Queen", OccupationType.Political, Guid.NewGuid());

            Meve.AddOccupation(queen);

            var relationship1 = itemLinkFactory.CreateRelationshipBetweenTwoPersons(Meve, Foltest, PersonalRelationshipTypeName.Wife, PersonalRelationshipTypeName.Husband);

            linkObjects.AddRange(relationship1);

            //Calanthe, The Lion Queen of Cintra
            var Calanthe = new Person("Calanthe", Gender.Female, Sex.Female, Orientation.Bisexual, Guid.NewGuid(), new CustomDateTime(1218), CalantheDesc)
            {
                DateOfDeath = new CustomDateTime(1265)
            };

            Occupation queenOfCintra = new Occupation("Queen of Cintra", Calanthe, OccupationType.Political, Guid.NewGuid(), new CustomDateTime(1232), new CustomDateTime(1263));

            Calanthe.AddOccupation(queenOfCintra);

            var association2 = itemLinkFactory.CreateAssociationBetweenPersonAndOrganization(Calanthe, governmentOfCintra, AssociationType.Leader, new CustomDateTime(1232), new CustomDateTime(1263));

            linkObjects.Add(association2);

            //Princess Pavetta of Cintra
            var Pavetta = new Person("Princess Pavetta", Gender.Female, Sex.Female, Orientation.Straight, Guid.NewGuid(), new CustomDateTime(1237), PavettaDesc)
            {
                DateOfDeath = new CustomDateTime(1257)
            };

            //Ciri, princess of Cintra. No, not the Apple thing.
            var Ciri = new Person("Princess Cirilla Fiona Elen Riannon", Gender.Female, Sex.Female, Orientation.Straight, Guid.NewGuid(), new CustomDateTime(1253, 5, 1), CiriDesc);

            var relationships1 = itemLinkFactory.CreateRelationshipBetweenTwoPersons(Calanthe, Pavetta, PersonalRelationshipTypeName.Mother, PersonalRelationshipTypeName.Daughter);
            var relationships2 = itemLinkFactory.CreateRelationshipBetweenTwoPersons(Pavetta, Ciri, PersonalRelationshipTypeName.Mother, PersonalRelationshipTypeName.Daughter, new CustomDateTime(1253, 5, 1));

            linkObjects.AddRange(relationships1);
            linkObjects.AddRange(relationships2);

            var persons = new List <Person> {
                GeraltOfRivia, Foltest, Calanthe, Pavetta, Ciri, Meve
            };

            //Events
            PastEvent ageOfMigration = new PastEvent("the Age of Migration", Guid.NewGuid(), MigrationDesc)
            {
                Type    = PastEventType.Social,
                Started = new CustomDateTime(-2230),
                Ended   = new CustomDateTime(-2230)
            };

            PastEvent theConjunction = new PastEvent("The Conjunction of the Spheres", Guid.NewGuid(), ConjunctionDesc, new CustomDateTime(-230), new CustomDateTime(-230))
            {
                Type = PastEventType.Magical
            };

            PastEvent theResurrection = new PastEvent("The Resurrection", Guid.NewGuid(), "", new CustomDateTime(1))
            {
                Type  = PastEventType.Magical,
                Ended = new CustomDateTime(1),
            };

            var link1 = itemLinkFactory.CreateLinkBetweenTwoEvents(theResurrection, theConjunction, EventRelationshipType.Preceded);

            linkObjects.AddRange(link1);

            PastEvent NilfgaardInvasion = new PastEvent("The Northern  Wars", Guid.NewGuid(), NorthernWarsDesc, new CustomDateTime(1239));
            PastEvent conquestOfRedania = new PastEvent("Conquest of Redania", Guid.NewGuid());
            PastEvent battleOfBrenna    = new PastEvent("The Battle Of Brenna", Guid.NewGuid(), BattleOfBrennaDesc, new CustomDateTime(1268, 03, 01));
            PastEvent conquestOfCintra  = new PastEvent("Conquest of Cintra", Guid.NewGuid());

            var link2 = itemLinkFactory.CreateLinkBetweenTwoEvents(NilfgaardInvasion, battleOfBrenna, EventRelationshipType.Included);

            linkObjects.AddRange(link2);

            var involvement1 = itemLinkFactory.CreateInvolvementBetweenPersonAndEvent(Foltest, NilfgaardInvasion, PersonalInvolvementType.WasCaughtIn);
            var involvement2 = itemLinkFactory.CreateInvolvementBetweenOccupationAndEvent(queenOfCintra, NilfgaardInvasion, OccupationalInvolvementType.DiedDuring);

            var involvement = itemLinkFactory.CreateInvolvementBetweenPersonAndEvent(GeraltOfRivia, NilfgaardInvasion, PersonalInvolvementType.FoughtIn);

            intermediateObjects.Add(involvement);
            intermediateObjects.Add(involvement1);
            intermediateObjects.Add(involvement2);

            PastEvent theRivianPogrom = new PastEvent("Rivian Pogrom", Guid.NewGuid(), TheRivianPogromDesc, new CustomDateTime(1268, 6, 6));

            itemLinkFactory.CreateInvolvementBetweenPersonAndEvent(GeraltOfRivia, theRivianPogrom, PersonalInvolvementType.DiedDuring, new CustomDateTime(1268, 6, 6));

            PastEvent independenceOfKovir = new PastEvent("Independence of Kovir", Guid.NewGuid(), IndependanceOfKovirDesc, new CustomDateTime(1140));

            Occupation kingOfRedania = new Occupation("King of Redania", OccupationType.Political, Guid.NewGuid(), "The King of Redania was known to wage war against Kovir when they declared their independance.");

            var involvement4 = itemLinkFactory.CreateInvolvementBetweenOccupationAndEvent(kingOfRedania, independenceOfKovir, OccupationalInvolvementType.WasCaughtIn, new CustomDateTime(1140));

            intermediateObjects.Add(involvement4);

            var events = new List <PastEvent> {
                ageOfMigration, theConjunction, theResurrection, NilfgaardInvasion, battleOfBrenna, theRivianPogrom, independenceOfKovir, conquestOfRedania, conquestOfCintra
            };

            //Places
            Place theContinent = new Place("The Continent", Guid.NewGuid(), ContinentDesc)
            {
                Coordinates = new Coordinates {
                    X = 1, Y = 1, Z = 1
                },
                Type = PlaceType.Continent
            };

            var conjunctionOccurence = itemLinkFactory.CreateOccurenceBetweenEventAndPlace(theConjunction, theContinent, OccurenceType.HappenedIn);

            intermediateObjects.Add(conjunctionOccurence);

            var occurence2 = itemLinkFactory.CreateOccurenceBetweenEventAndPlace(NilfgaardInvasion, theContinent, OccurenceType.HappenedIn);

            intermediateObjects.Add(occurence2);

            Place Temeria = new Place("Temeria", Guid.NewGuid(), new Coordinates {
                X = -700, Y = 333, Z = -2
            }, TemeriaDesc)
            {
                Type = PlaceType.Kingdom
            };

            var link3 = itemLinkFactory.CreateLinkBetweenTwoPlaces(theContinent, Temeria, GeographicRelationshipType.Includes);
            var tie1  = itemLinkFactory.CreateTieBetweenPersonAndPlace(Foltest, Temeria, PersonalTieType.Led);

            linkObjects.AddRange(link3);
            linkObjects.Add(tie1);

            Place kingdomOfRedania = new Place("Redania", Guid.NewGuid())
            {
                Type = PlaceType.Kingdom
            };

            var redaniaLink = itemLinkFactory.CreateTieBetweenOccupationAndPlace(kingOfRedania, kingdomOfRedania, OccupationalTieType.Led);

            intermediateObjects.Add(redaniaLink);

            var conquest = itemLinkFactory.CreateOccurenceBetweenEventAndPlace(conquestOfRedania, kingdomOfRedania, OccurenceType.Conquest);

            intermediateObjects.Add(conquest);
            itemLinkFactory.CreateInvolvementBetweenOccupationAndEvent(EmperorOfNilfgaard, conquestOfRedania, OccupationalInvolvementType.Led);

            Place Sodden = new Place("Sodden", Guid.NewGuid(), SoddenDesc)
            {
                Type        = PlaceType.State,
                Coordinates = new Coordinates {
                    X = -1023, Y = 566, Z = 50
                }
            };

            var link4 = itemLinkFactory.CreateLinkBetweenTwoPlaces(Temeria, Sodden, GeographicRelationshipType.Includes);

            linkObjects.AddRange(link4);

            Place Vizima = new Place("Vizima", Guid.NewGuid(), new Coordinates {
                X = -746, Y = 656, Z = 142
            }, VizimaDesc, new CustomDateTime(849))
            {
                Type = PlaceType.City
            };

            var link5 = itemLinkFactory.CreateLinkBetweenTwoPlaces(Temeria, Vizima, GeographicRelationshipType.Includes, new CustomDateTime(849));

            linkObjects.AddRange(link5);

            Place theNecropolis = new Place("The necropolis", Guid.NewGuid(), FenCaernDesc)
            {
                Type     = PlaceType.Cemetary,
                Creation = new CustomDateTime(760)
            };

            Place Cintra = new Place("Cintra", Guid.NewGuid())
            {
                Type = PlaceType.Kingdom,
            };

            var tie2       = itemLinkFactory.CreateTieBetweenPersonAndPlace(Calanthe, Cintra, PersonalTieType.Led, new CustomDateTime(1232), new CustomDateTime(1263));
            var tie3       = itemLinkFactory.CreateTieBetweenOccupationAndPlace(queenOfCintra, Cintra, OccupationalTieType.DiedIn);
            var occurence3 = itemLinkFactory.CreateOccurenceBetweenEventAndPlace(conquestOfCintra, Cintra, OccurenceType.Conquest);
            var tie5       = itemLinkFactory.CreateTieBetweenOccupationAndPlace(EmperorOfNilfgaard, Cintra, OccupationalTieType.Conquered);

            linkObjects.Add(tie2);
            linkObjects.Add(tie3);

            intermediateObjects.Add(occurence3);
            intermediateObjects.Add(tie5);

            Place Nilfgaard = new Place("Nilfgaard", Guid.NewGuid())
            {
                Type = PlaceType.Kingdom,
            };

            //TODO
            var link6 = itemLinkFactory.CreateLinkBetweenTwoPlaces(Cintra, Nilfgaard, GeographicRelationshipType.PartOf);
            var link7 = itemLinkFactory.CreateLinkBetweenTwoPlaces(Nilfgaard, Temeria, GeographicRelationshipType.SouthOf);
            var tie4  = itemLinkFactory.CreateTieBetweenOccupationAndPlace(EmperorOfNilfgaard, Nilfgaard, OccupationalTieType.Led);

            linkObjects.AddRange(link6);
            linkObjects.AddRange(link7);

            intermediateObjects.Add(tie4);

            Place      Skellige = new Place("The Isles of Skellige", Guid.NewGuid());
            Occupation Vikings  = new Occupation("Vikings", OccupationType.Independant, Guid.NewGuid(), "Brutal warriors");

            var link8 = itemLinkFactory.CreateTieBetweenOccupationAndPlace(Vikings, Skellige, OccupationalTieType.OriginatedFrom);

            linkObjects.Add(link8);

            var Aedirn = new Place("Aedirn", Guid.NewGuid())
            {
                Type     = PlaceType.Kingdom,
                Creation = new CustomDateTime(813)
            };

            var foundationOfAedirn = new PastEvent("The Foundation of Aedirn", Guid.NewGuid(), "", new CustomDateTime(813), new CustomDateTime(813))
            {
                Type = PastEventType.Political
            };

            events.Add(foundationOfAedirn);

            var link9 = itemLinkFactory.CreateOccurenceBetweenEventAndPlace(foundationOfAedirn, Aedirn, OccurenceType.Creation);

            linkObjects.Add(link9);

            Place kingdomOfKovir = new Place("Kovir", Guid.NewGuid(), new Coordinates(), KingdomOfKovirDesc, new CustomDateTime(1140))
            {
                Type = PlaceType.Kingdom
            };

            var involvement3 = itemLinkFactory.CreateTieBetweenOccupationAndPlace(kingOfRedania, kingdomOfKovir, OccupationalTieType.FoughtAgainst, new CustomDateTime(1140));

            intermediateObjects.Add(involvement3);

            var occurence1 = itemLinkFactory.CreateOccurenceBetweenEventAndPlace(independenceOfKovir, kingdomOfKovir, OccurenceType.Creation, new CustomDateTime(1140));

            intermediateObjects.Add(occurence1);

            var places = new List <Place> {
                theContinent, Temeria, Sodden, Vizima, theNecropolis, Cintra, Nilfgaard, kingdomOfKovir, Skellige, Aedirn, kingdomOfRedania
            };
            var occupations = new List <Occupation> {
                EmperorOfNilfgaard, queenOfCintra, kingOfRedania, kingOfTemeria, witcherGeralt, Vikings, queen
            };

            var items = new List <MemoryItem>();

            items.AddRange(persons);
            items.AddRange(events);
            items.AddRange(places);
            items.AddRange(organizations);
            items.AddRange(occupations);
            items.AddRange(linkObjects);
            items.AddRange(intermediateObjects);

            return(items);
        }