Example #1
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);
        }
Example #2
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);
        }
        /// <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 #4
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 #5
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);
        }