Пример #1
0
        public IEntity CreateFromTemplate(IEntityTemplate template,
                                          Vector2Int position,
                                          string name = null,
                                          IDictionary <string, IEntityStatistic> statistics = null,
                                          IDictionary <string, IDerivedValue> derivedValues = null,
                                          IDictionary <string, IEntitySkill> skills         = null,
                                          IEnumerable <IAbility> abilities = null,
                                          IEnumerable <ICulture> cultures  = null,
                                          IGender gender       = null,
                                          IBioSex sex          = null,
                                          ISexuality sexuality = null,
                                          IRomance romance     = null,
                                          IJob job             = null,
                                          IEnumerable <ISpriteState> sprites = null,
                                          IWorldInstance world = null,
                                          IDriver driver       = null)
        {
            string     selectedName      = name;
            IJob       selectedJob       = job;
            IGender    selectedGender    = gender;
            IBioSex    selectedSex       = sex;
            ISexuality selectedSexuality = sexuality;
            IRomance   selectedRomance   = romance;
            IEnumerable <ISpriteState> selectedSprites  = sprites;
            List <ICulture>            creatureCultures = new List <ICulture>();
            IDriver selectedDriver = driver;
            IDictionary <string, IEntityStatistic> selectedStatistics = statistics;
            IDictionary <string, IDerivedValue>    selectedDVs        = derivedValues;
            IDictionary <string, IEntitySkill>     selectedSkills     = skills;
            IEnumerable <IAbility> selectedAbilities = abilities;

            if (!(cultures is null))
            {
                creatureCultures.AddRange(cultures);
            }
Пример #2
0
        public bool Add(ISexuality value)
        {
            if (this.Sexualities.ContainsKey(value.Name))
            {
                return(false);
            }

            this.Sexualities.Add(value.Name, value);
            return(true);
        }
Пример #3
0
        public void SetUpHumans()
        {
            IBioSex femaleSex = Mock.Of <IBioSex>(
                sex => sex.Name == "female" &&
                sex.CanBirth == true);
            IBioSex maleSex = Mock.Of <IBioSex>(
                sex => sex.Name == "male" &&
                sex.CanBirth == false);

            IGender femaleGender = Mock.Of <IGender>(gender => gender.Name == "female");
            IGender maleGender   = Mock.Of <IGender>(gender => gender.Name == "male");

            this.heterosexual = this.target.Get("heterosexual");
            this.homosexual   = this.target.Get("homosexual");
            this.bisexual     = this.target.Get("pansexual");
            this.asexual      = this.target.Get("asexual");

            this.heterofemaleHuman = Mock.Of <IEntity>(
                entity => entity.Gender == femaleGender &&
                entity.Sexuality == this.heterosexual &&
                entity.Guid == Guid.NewGuid());

            this.heteroMaleHuman = Mock.Of <IEntity>(
                entity => entity.Gender == maleGender &&
                entity.Sexuality == this.heterosexual &&
                entity.Guid == Guid.NewGuid());

            this.homoMaleHumanLeft = Mock.Of <IEntity>(
                entity => entity.Gender == maleGender &&
                entity.Sexuality == this.homosexual &&
                entity.Guid == Guid.NewGuid());

            this.homoMaleHumanRight = Mock.Of <IEntity>(
                entity => entity.Gender == maleGender &&
                entity.Sexuality == this.homosexual &&
                entity.Guid == Guid.NewGuid());

            this.homofemaleHumanLeft = Mock.Of <IEntity>(
                entity => entity.Gender == femaleGender &&
                entity.Sexuality == this.homosexual &&
                entity.Guid == Guid.NewGuid());

            this.homofemaleHumanRight = Mock.Of <IEntity>(
                entity => entity.Gender == femaleGender &&
                entity.Sexuality == this.homosexual &&
                entity.Guid == Guid.NewGuid());

            this.biMaleHuman = Mock.Of <IEntity>(
                entity => entity.Gender == maleGender &&
                entity.Sexuality == this.bisexual &&
                entity.Guid == Guid.NewGuid());

            this.bifemaleHuman = Mock.Of <IEntity>(
                entity => entity.Gender == femaleGender &&
                entity.Sexuality == this.bisexual &&
                entity.Guid == Guid.NewGuid());

            this.asexualMaleHuman = Mock.Of <IEntity>(
                entity => entity.Gender == maleGender &&
                entity.Sexuality == this.asexual &&
                entity.Guid == Guid.NewGuid());


            IEntity[] heteroCouple     = new IEntity[] { this.heterofemaleHuman, this.heteroMaleHuman };
            IEntity[] homofemaleCouple = new IEntity[] { this.homofemaleHumanLeft, this.homofemaleHumanRight };
            IEntity[] homoMaleCouple   = new IEntity[] { this.homoMaleHumanLeft, this.homoMaleHumanRight };
            IEntity[] biCoupleLeft     = new IEntity[] { this.bifemaleHuman, this.homofemaleHumanLeft };
            IEntity[] biCoupleRight    = new IEntity[] { this.bifemaleHuman, this.biMaleHuman };
            IEntity[] asexualCouple    = new IEntity[] { this.asexualMaleHuman, this.bifemaleHuman };

            this.RelationshipHandler.CreateRelationshipWithValue(heteroCouple, new[] { "sexual" }, 500);
            this.RelationshipHandler.CreateRelationshipWithValue(homofemaleCouple, new[] { "sexual" }, 500);
            this.RelationshipHandler.CreateRelationshipWithValue(homoMaleCouple, new[] { "sexual" }, 500);
            this.RelationshipHandler.CreateRelationshipWithValue(biCoupleLeft, new[] { "sexual" }, 500);
            this.RelationshipHandler.CreateRelationshipWithValue(biCoupleRight, new[] { "sexual" }, 500);
            this.RelationshipHandler.CreateRelationshipWithValue(asexualCouple, new[] { "sexual" }, 500);
        }