Example #1
0
 public PastEvent(string name, Guid referenceId, string description, GameTime.GameTime startedOn = null) : base(referenceId)
 {
     Name        = name;
     Description = description;
     Started     = startedOn;
     ItemType    = MemoryItemType.PastEvent;
 }
Example #2
0
 internal Occurence(Place linkedLocation, PastEvent linkedEvent, OccurenceType type, Guid referenceId, GameTime.GameTime started, GameTime.GameTime ended = null) : base(type, referenceId)
 {
     LinkedLocation = linkedLocation;
     LinkedEvent    = linkedEvent;
     Started        = started;
     Ended          = ended;
     ItemType       = MemoryItemType.Occurence;
 }
 internal OccupationalTie(Place linkedLocation, Occupation linkedOccupation, OccupationalTieType type, Guid referenceId, GameTime.GameTime started, GameTime.GameTime ended = null) : base(type, referenceId)
 {
     LinkedLocation   = linkedLocation;
     LinkedOccupation = linkedOccupation;
     Started          = started;
     Ended            = ended;
     ItemType         = MemoryItemType.OccupationalTie;
 }
 internal PersonalInvolvement(PastEvent linkedEvent, Person linkedPerson, PersonalInvolvementType type, Guid referenceId, GameTime.GameTime started, GameTime.GameTime ended = null) : base(type, referenceId)
 {
     LinkedEvent  = linkedEvent;
     LinkedPerson = linkedPerson;
     Started      = started;
     Ended        = ended;
     ItemType     = MemoryItemType.PersonalInvolvement;
 }
Example #5
0
 public Place(string name, Guid referenceId, Coordinates coordinates, string description = "", GameTime.GameTime creation = null, GameTime.GameTime destruction = null) : base(referenceId)
 {
     Name        = name;
     Description = description;
     Coordinates = coordinates;
     Creation    = creation;
     Destruction = destruction;
     ItemType    = MemoryItemType.Place;
 }
Example #6
0
        /// <summary>
        /// Returns the age of the person
        /// </summary>
        /// <returns></returns>
        public int Age(GameTime.GameTime currentGameTime)
        {
            if (DateOfDeath != null)
            {
                return((int)DateOfBirth.TimeElapsedInYearsSince(DateOfDeath));
            }

            return((int)DateOfBirth.TimeElapsedInYearsSince(currentGameTime));
        }
Example #7
0
 public Person(string personName, Gender gender, Sex sex, Orientation orientation, Guid referenceId, GameTime.GameTime dateOfBirth, string description = "") : base(referenceId)
 {
     ItemType    = MemoryItemType.Person;
     Name        = personName;
     Description = description;
     Orientation = orientation;
     Gender      = gender;
     Sex         = sex;
     DateOfBirth = dateOfBirth;
     ItemType    = MemoryItemType.Person;
 }
Example #8
0
        internal PlaceRelationship(Place linkedPlace, GeographicRelationshipType firstToSecondPlaceRelationship, Guid referenceId, GameTime.GameTime started, GameTime.GameTime ended = null) : base(firstToSecondPlaceRelationship, referenceId)
        {
            if (linkedPlace == null)
            {
                throw new ArgumentNullException(nameof(linkedPlace), @"Cannot link a Place to nothing.");
            }

            LinkedPlace = linkedPlace;
            // SetDescription(firstToSecondPlaceRelationship);

            Started = started;
            Ended   = ended;

            ItemType = MemoryItemType.PlaceRelationship;
        }
Example #9
0
        /// <inheritdoc />
        /// <summary>
        /// Returns a copy of the object with all the information copied inaccurately
        /// this represents the character having wrong information
        /// </summary>
        /// <returns>Item with the information</returns>
        public override MemoryItem GetInaccurateCopy()
        {
            GameTime.GameTime birthDate   = DateOfBirth;
            GameTime.GameTime deathDate   = DateOfDeath;
            Orientation       orientation = Orientation;
            //TODO : Randomize name

            int falsificationCase = RandomValueGenerator.GenerateIntWithMaxValue(4);

            switch (falsificationCase)
            {
            case 1:
                int variance = RandomValueGenerator.GenerateRealWithinValues(-30, 30);
                birthDate?.SetYear(birthDate.GetYear() + variance);
                break;

            case 2:
                int deathVariance = RandomValueGenerator.GenerateRealWithinValues(-30, 30);
                deathDate?.SetYear(deathDate.GetYear() + deathVariance);
                break;

            case 3:
                orientation = (Orientation)RandomValueGenerator.GenerateIntWithMaxValue(Enum.GetNames(typeof(Orientation)).Length);
                break;

            case 4:
                variance = RandomValueGenerator.GenerateRealWithinValues(-30, 30);
                birthDate?.SetYear(birthDate.GetYear() + variance);
                orientation = (Orientation)RandomValueGenerator.GenerateIntWithMaxValue(Enum.GetNames(typeof(Orientation)).Length);
                break;
            }

            Person copy = new Person(Name, Gender, Sex, orientation, ReferenceId)
            {
                DateOfBirth    = birthDate,
                DateOfDeath    = deathDate,
                Description    = Description,
                ItemType       = ItemType,
                _associations  = _associations,
                _linkedEvents  = _linkedEvents,
                _linkedPlaces  = _linkedPlaces,
                _occupations   = _occupations,
                _relationships = _relationships
            };

            return(copy);
        }
        /// <inheritdoc />
        public override MemoryItem GetInaccurateCopy()
        {
            GameTime.GameTime   started = Started;
            GameTime.GameTime   ended   = Ended;
            OccupationalTieType type    = Type;

            //TODO : Randomize name

            int falsificationCase = RandomValueGenerator.GenerateIntWithMaxValue(4);

            switch (falsificationCase)
            {
            case 1:
                int variance = RandomValueGenerator.GenerateRealWithinValues(-10, 10);
                started?.SetYear(started.GetYear() + variance);
                break;

            case 2:
                int deathVariance = RandomValueGenerator.GenerateRealWithinValues(-10, 10);
                ended?.SetYear(ended.GetYear() + deathVariance);
                break;

            case 3:
                type = (OccupationalTieType)RandomValueGenerator.GenerateIntWithMaxValue(Enum.GetNames(typeof(OccupationalTieType)).Length);
                break;

            case 4:
                type     = (OccupationalTieType)RandomValueGenerator.GenerateIntWithMaxValue(Enum.GetNames(typeof(OccupationalTieType)).Length);
                variance = RandomValueGenerator.GenerateRealWithinValues(-10, 10);
                started?.SetYear(started.GetYear() + variance);
                break;
            }

            var copy = new OccupationalTie(LinkedLocation, LinkedOccupation, type, ReferenceId)
            {
                ItemType           = ItemType,
                Description        = Description,
                Started            = started,
                Ended              = ended,
                ReverseDescription = ReverseDescription,
                Name = Name
            };

            return(copy);
        }
Example #11
0
        /// <summary>
        /// Returns a copy of the object with all the information copied inaccurately
        /// this represents the character having wrong information
        /// </summary>
        /// <returns>Item with the information</returns>
        public override MemoryItem GetInaccurateCopy()
        {
            GameTime.GameTime creation    = Creation;
            GameTime.GameTime destruction = Destruction;
            PlaceType         placeType   = Type;

            //TODO : Randomize name

            int falsificationCase = RandomValueGenerator.GenerateIntWithMaxValue(4);

            switch (falsificationCase)
            {
            case 1:
                int variance = RandomValueGenerator.GenerateRealWithinValues(-30, 30);
                creation?.SetYear(creation.GetYear() + variance);
                break;

            case 2:
                int deathVariance = RandomValueGenerator.GenerateRealWithinValues(-30, 30);
                destruction?.SetYear(destruction.GetYear() + deathVariance);
                break;

            case 3:
                placeType = (PlaceType)RandomValueGenerator.GenerateIntWithMaxValue(Enum.GetNames(typeof(PlaceType)).Length);
                break;

            case 4:
                placeType = (PlaceType)RandomValueGenerator.GenerateIntWithMaxValue(Enum.GetNames(typeof(PlaceType)).Length);
                variance  = RandomValueGenerator.GenerateRealWithinValues(-30, 30);
                creation?.SetYear(creation.GetYear() + variance);
                break;
            }

            var copy = new Place(Name, ReferenceId, Coordinates, Description, Creation, Destruction)
            {
                Type                = placeType,
                ItemType            = ItemType,
                _linkedPlaces       = _linkedPlaces,
                _linkedEvents       = _linkedEvents,
                _linkedPersons      = _linkedPersons,
                _relatedOccupations = _relatedOccupations
            };

            return(copy);
        }
Example #12
0
        /// <summary>
        /// Returns a copy of the object with all the information copied inaccurately
        /// this represents the character having wrong information
        /// </summary>
        /// <returns>Item with the information</returns>
        public override MemoryItem GetInaccurateCopy()
        {
            GameTime.GameTime started = Started;
            GameTime.GameTime ended   = Ended;
            PastEventType     type    = Type;

            //TODO : Randomize name

            int falsificationCase = RandomValueGenerator.GenerateIntWithMaxValue(4);

            switch (falsificationCase)
            {
            case 1:
                int variance = RandomValueGenerator.GenerateRealWithinValues(-15, 15);
                started?.SetYear(started.GetYear() + variance);
                break;

            case 2:
                int deathVariance = RandomValueGenerator.GenerateRealWithinValues(-15, 15);
                ended?.SetYear(ended.GetYear() + deathVariance);
                break;

            case 3:
                type = (PastEventType)RandomValueGenerator.GenerateIntWithMaxValue(Enum.GetNames(typeof(PastEventType)).Length);
                break;

            case 4:
                type     = (PastEventType)RandomValueGenerator.GenerateIntWithMaxValue(Enum.GetNames(typeof(PastEventType)).Length);
                variance = RandomValueGenerator.GenerateRealWithinValues(-15, 15);
                started?.SetYear(started.GetYear() + variance);
                break;
            }

            var copy = new PastEvent(Name, ReferenceId, Description, started, ended)
            {
                ItemType           = ItemType,
                _linkedPlaces      = _linkedPlaces,
                _linkedEvents      = _linkedEvents,
                _linkedOccupations = _linkedOccupations,
                _linkedPersons     = _linkedPersons,
                Type = type
            };

            return(copy);
        }
Example #13
0
        /// <summary>
        /// Returns a copy of the object with all the information copied inaccurately
        /// this represents the character having wrong information
        /// </summary>
        /// <returns>Item with the information</returns>
        public override MemoryItem GetInaccurateCopy()
        {
            GameTime.GameTime started = Started;
            GameTime.GameTime ended   = Ended;
            OrganizationType  type    = Type;

            //TODO : Randomize name

            int falsificationCase = RandomValueGenerator.GenerateIntWithMaxValue(4);

            switch (falsificationCase)
            {
            case 1:
                int variance = RandomValueGenerator.GenerateRealWithinValues(-30, 30);
                started?.SetYear(started.GetYear() + variance);
                break;

            case 2:
                int deathVariance = RandomValueGenerator.GenerateRealWithinValues(-30, 30);
                ended?.SetYear(ended.GetYear() + deathVariance);
                break;

            case 3:
                type = (OrganizationType)RandomValueGenerator.GenerateIntWithMaxValue(Enum.GetNames(typeof(OrganizationType)).Length);
                break;

            case 4:
                type     = (OrganizationType)RandomValueGenerator.GenerateIntWithMaxValue(Enum.GetNames(typeof(OrganizationType)).Length);
                variance = RandomValueGenerator.GenerateRealWithinValues(-30, 30);
                started?.SetYear(started.GetYear() + variance);
                break;
            }

            Organization copy = new Organization(Name, type, ReferenceId, Description)
            {
                ItemType      = ItemType,
                Started       = started,
                Ended         = ended,
                _associations = _associations
            };

            return(copy);
        }
Example #14
0
        /// <summary>
        /// This creates a link between two places and adds the reference to both places
        /// </summary>
        /// <param name="firstPlaceToLink">First place to link</param>
        /// <param name="secondPlaceToLink">Second Place to link</param>
        /// <param name="firstToSecondPlaceRelationship">Nature of their link</param>
        /// <param name="started">Date Started</param>
        /// <param name="ended">Date Ended</param>
        /// <returns>The new links (2)</returns>
        public List <PlaceRelationship> CreateLinkBetweenTwoPlaces(Place firstPlaceToLink, Place secondPlaceToLink, GeographicRelationshipType firstToSecondPlaceRelationship, GameTime.GameTime started, GameTime.GameTime ended = null)
        {
            PlaceRelationship directRelationship = new PlaceRelationship(secondPlaceToLink, firstToSecondPlaceRelationship, Guid.NewGuid(), started, ended);

            firstPlaceToLink.AddLinkedPlace(directRelationship);

            PlaceRelationship reverseRelationship = new PlaceRelationship(firstPlaceToLink, GetReverseLinkType(firstToSecondPlaceRelationship), Guid.NewGuid(), started, ended);

            secondPlaceToLink.AddLinkedPlace(reverseRelationship);

            return(new List <PlaceRelationship> {
                directRelationship, reverseRelationship
            });
        }
Example #15
0
        /// <summary>
        /// This will create relationship objects linking two Occupations together and add a reference to both
        /// </summary>
        /// <param name="firstParty">The first Person in the relationship. If the terms for each party is different, this will be the left term
        /// Example: Mother-Daughter relationship. firstParty will be the mother.</param>
        /// <param name="secondParty">The second person in the relationship and the one associated with the term on the right</param>
        /// <param name="firstPartyRole">Name of the relationship from the first party's perspective, i,e mother. Use the enum.</param>
        /// <param name="secondPartyRole">Name of the relationship from the second party's perspective, i,e daughter. Use the enum</param>
        /// <param name="started">Date relationship started. Is used to diffentiate relationships that have started and stopped and started again (i.e. on and off friends)
        /// </param>
        /// <param name="ended">Date relationship ended</param>
        /// <returns>The new links (2)</returns>
        public List <PersonalRelationship> CreateRelationshipBetweenTwoPersons(Person firstParty, Person secondParty, PersonalRelationshipTypeName firstPartyRole,
                                                                               PersonalRelationshipTypeName secondPartyRole, GameTime.GameTime started, GameTime.GameTime ended = null)
        {
            string description        = PersonalRelationshipDetails.Instance.GetRelationshipDescription(firstPartyRole.ToString());
            string reverseDescription = PersonalRelationshipDetails.Instance.GetRelationshipDescription(secondPartyRole.ToString());
            var    type = PersonalRelationshipDetails.Instance.GetRelationshipTypeName(firstPartyRole.ToString());

            var newRelationship1 = new PersonalRelationship(secondParty, type, Guid.NewGuid(), description)
            {
                Name    = firstPartyRole + "-" + secondPartyRole,
                Started = started,
                Ended   = ended
            };

            firstParty.AddRelationship(newRelationship1);

            var newRelationship2 = new PersonalRelationship(firstParty, type, Guid.NewGuid(), reverseDescription)
            {
                Name    = firstPartyRole + "-" + secondPartyRole,
                Started = started,
                Ended   = ended
            };

            secondParty.AddRelationship(newRelationship2);

            return(new List <PersonalRelationship> {
                newRelationship1, newRelationship2
            });
        }
Example #16
0
        /// <summary>
        /// Creates an association  between Person and Organization
        /// </summary>
        /// <param name="linkedPerson">Linked Person</param>
        /// <param name="linkedOrganization">Linked Organization</param>
        /// <param name="type">Nature of the Association</param>
        /// <param name="started">Date Started</param>
        /// <param name="ended">Date Ended</param>
        /// <returns>The new link</returns>
        public Association CreateAssociationBetweenPersonAndOrganization(Person linkedPerson, Organization linkedOrganization, AssociationType type, GameTime.GameTime started, GameTime.GameTime ended = null)
        {
            var association = new Association(linkedPerson, linkedOrganization, type, Guid.NewGuid(), started, ended);

            linkedPerson.AddAssociation(association);
            linkedOrganization.AddAssociation(association);

            return(association);
        }
Example #17
0
 public Occupation(string occupationName, Person occupationHolder, OccupationType type, Guid referenceId, GameTime.GameTime started, GameTime.GameTime ended = null, string description = "") :
     this(occupationName, occupationHolder, type, referenceId, description)
 {
     Started = started;
     Ended   = ended;
 }
Example #18
0
        /// <summary>
        /// This relationship links an Occupation and an Event. It was created to admit that someone might not know the Person linked to an Occupation, i.e. the King of Temeria.
        /// </summary>
        /// <param name="linkedOccupation">Occupation linked</param>
        /// <param name="linkedEvent">Event linked</param>
        /// <param name="type">Nature of the link between Occupation and Event</param>
        /// <param name="started">Date Started</param>
        /// <param name="ended">Date Ended</param>
        /// <returns>The new link</returns>
        public OccupationalInvolvement CreateInvolvementBetweenOccupationAndEvent(Occupation linkedOccupation, PastEvent linkedEvent, OccupationalInvolvementType type, GameTime.GameTime started, GameTime.GameTime ended = null)
        {
            var occupationalInvolvement = new OccupationalInvolvement(linkedEvent, linkedOccupation, type, Guid.NewGuid(), started, ended);

            linkedOccupation.AddLinkedEvent(occupationalInvolvement);
            linkedEvent.AddOccupation(occupationalInvolvement);

            return(occupationalInvolvement);
        }
Example #19
0
        /// <summary>
        /// This relationship links an Occupation and an Place. It was created to admit that someone might not know the Person linked to an Occupation, i.e. the King of Temeria.
        /// </summary>
        /// <param name="linkedOccupation">Occupation linked</param>
        /// <param name="linkedPlace">Linked Place</param>
        /// <param name="type">Nature of the link between Occupation and Place</param>
        /// <param name="started">Date Started</param>
        /// <param name="ended">Date Ended</param>
        /// <returns>The new link</returns>
        public OccupationalTie CreateTieBetweenOccupationAndPlace(Occupation linkedOccupation, Place linkedPlace, OccupationalTieType type, GameTime.GameTime started, GameTime.GameTime ended = null)
        {
            var occupationalTie = new OccupationalTie(linkedPlace, linkedOccupation, type, Guid.NewGuid(), started, ended);

            linkedOccupation.AddLinkedPlace(occupationalTie);
            linkedPlace.AddLinkedOccupation(occupationalTie);

            return(occupationalTie);
        }
Example #20
0
        /// <summary>
        /// Creates a link that defines a link between a Person and an Event
        /// </summary>
        /// <param name="linkedPerson">Linked Person</param>
        /// <param name="linkedEvent">Event linked</param>
        /// <param name="type">How a Person was involved in an Event</param>
        /// <param name="started">Date Started</param>
        /// <param name="ended">Date Ended</param>
        public PersonalInvolvement CreateInvolvementBetweenPersonAndEvent(Person linkedPerson, PastEvent linkedEvent, PersonalInvolvementType type, GameTime.GameTime started, GameTime.GameTime ended = null)
        {
            var personalInvolvement = new PersonalInvolvement(linkedEvent, linkedPerson, type, Guid.NewGuid(), started, ended);

            linkedPerson.AddPersonalInvolvement(personalInvolvement);
            linkedEvent.AddAssociatedPerson(personalInvolvement);

            return(personalInvolvement);
        }
Example #21
0
        /// <summary>
        /// Creates a link between a Person and a Place.
        /// </summary>
        /// <param name="linkedPerson">Linked Person</param>
        /// <param name="linkedPlace">Linked Place</param>
        /// <param name="type">The nature of the tie between a Person and a Place</param>
        /// <param name="started">Date Started</param>
        /// <param name="ended">Date Ended</param>
        /// <returns>The new link</returns>
        public PersonalTie CreateTieBetweenPersonAndPlace(Person linkedPerson, Place linkedPlace, PersonalTieType type, GameTime.GameTime started, GameTime.GameTime ended = null)
        {
            var personalTie = new PersonalTie(linkedPlace, linkedPerson, type, Guid.NewGuid(), started, ended);

            linkedPerson.AddLinkedPlace(personalTie);
            linkedPlace.AddLinkedPerson(personalTie);

            return(personalTie);
        }
Example #22
0
        /// <summary>
        /// Creates a link between an Event and a Place
        /// </summary>
        /// <param name="linkedEvent">Event linked</param>
        /// <param name="linkedPlace">Linked Place</param>
        /// <param name="type">Nature of the link between Place and Event</param>
        /// <param name="started">Date Started</param>
        /// <param name="ended">Date Ended</param>
        /// <returns>The new link</returns>
        public Occurence CreateOccurenceBetweenEventAndPlace(PastEvent linkedEvent, Place linkedPlace, OccurenceType type, GameTime.GameTime started, GameTime.GameTime ended = null)
        {
            var occurence = new Occurence(linkedPlace, linkedEvent, type, Guid.NewGuid(), started, ended);

            linkedPlace.AddLinkedEvent(occurence);
            linkedEvent.AddLinkedPlace(occurence);

            return(occurence);
        }
Example #23
0
 public Association FindAssociation(Organization withOrganization, AssociationType type, GameTime.GameTime startingAt)
 {
     return(_associations.FirstOrDefault(p => p.AssociatedOrganization.Equals(withOrganization) && p.Type == type && p.Started == startingAt));
 }