示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#6
0
        /// <inheritdoc />
        public override MemoryItem GetInaccurateCopy()
        {
            global::RNPC.Core.GameTime.GameTime started = Started;
            global::RNPC.Core.GameTime.GameTime ended   = Ended;
            AssociationType 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 = (AssociationType)RandomValueGenerator.GenerateIntWithMaxValue(Enum.GetNames(typeof(AssociationType)).Length);
                break;

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

            Association copy = new Association(AssociatedPerson, AssociatedOrganization, type, ReferenceId, started, ended)
            {
                ItemType           = ItemType,
                ReverseDescription = ReverseDescription
            };

            return(copy);
        }
        /// <summary>
        /// Put a character through a year of events and training
        /// </summary>
        /// <param name="characterToTrain">Caracter to be trained</param>
        /// <returns></returns>
        public bool TrainForAYear(Character characterToTrain)
        {
            for (int i = 0; i < TrainingStatistics.DaysPerYear; i++)
            {
                int numberOfEventsForTheDay = RandomValueGenerator.GenerateRealWithinValues(TrainingStatistics.MinimumEventsPerDay, TrainingStatistics.MaximumEventsPerDay);

                for (int j = 0; j < numberOfEventsForTheDay; j++)
                {
                    characterToTrain.InteractWithMe(RandomEventGenerator.GetRandomEvent());
                }

                characterToTrain.GoToSleep(new LearningController());

                if (i % 30 == 0)
                {
                    OneMonthTrained?.Invoke(this, characterToTrain);
                }
            }

            return(true);
        }