Пример #1
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);
        }
Пример #2
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>
        /// <returns>The new link</returns>
        public OccupationalInvolvement CreateInvolvementBetweenOccupationAndEvent(Occupation linkedOccupation, PastEvent linkedEvent, OccupationalInvolvementType type)
        {
            var occupationalInvolvement = new OccupationalInvolvement(linkedEvent, linkedOccupation, type, Guid.NewGuid());

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

            return(occupationalInvolvement);
        }
Пример #3
0
        public void AddLinkedEvent(OccupationalInvolvement pastEvent)
        {
            if (_linkedEvents == null)
            {
                _linkedEvents = new List <OccupationalInvolvement>();
            }

            if (!_linkedEvents.Exists(e => e.Name == pastEvent.Name))
            {
                _linkedEvents.Add(pastEvent);
            }
        }
Пример #4
0
        public void AddOccupation(OccupationalInvolvement newOccupation)
        {
            if (_linkedOccupations == null)
            {
                _linkedOccupations = new List <OccupationalInvolvement>();
            }

            if (!_linkedOccupations.Exists(o => o.Name == newOccupation.Name &&
                                           o.LinkedOccupation.OccupationHolder == newOccupation.LinkedOccupation.OccupationHolder))
            {
                _linkedOccupations.Add(newOccupation);
            }
        }
        /// <inheritdoc />
        public override MemoryItem GetAccurateCopy()
        {
            var copy = new OccupationalInvolvement(LinkedEvent, LinkedOccupation, Type, ReferenceId)
            {
                ItemType           = ItemType,
                Description        = Description,
                Started            = Started,
                Ended              = Ended,
                ReverseDescription = ReverseDescription,
                Name = Name
            };

            return(copy);
        }
        /// <inheritdoc />
        public override MemoryItem GetInaccurateCopy()
        {
            GameTime.GameTime           started = Started;
            GameTime.GameTime           ended   = Ended;
            OccupationalInvolvementType 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 = (OccupationalInvolvementType)RandomValueGenerator.GenerateIntWithMaxValue(Enum.GetNames(typeof(OccupationalInvolvementType)).Length);
                break;

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

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

            return(copy);
        }