Ejemplo n.º 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);
            }
Ejemplo n.º 2
0
        public void SetUp()
        {
            ActionLog actionLog = new ActionLog();

            GlobalConstants.ActionLog = actionLog;
            this.scriptingEngine      = new ScriptingEngine();

            this.RelationshipHandler = new EntityRelationshipHandler();

            ICultureHandler cultureHandler = Mock.Of <ICultureHandler>(
                handler => handler.Cultures == new ICulture[]
            {
                Mock.Of <ICulture>(culture => culture.RomanceTypes ==
                                   new string[]
                {
                    "heteroromantic",
                    "homoromantic",
                    "panromantic",
                    "aromantic"
                })
            });

            GlobalConstants.GameManager = Mock.Of <IGameManager>(
                manager => manager.RelationshipHandler == this.RelationshipHandler &&
                manager.CultureHandler == cultureHandler);

            this.target = new EntityRomanceHandler();

            this.heteroromantic = this.target.Get("heteroromantic");
            this.homoromantic   = this.target.Get("homoromantic");
            this.biromantic     = this.target.Get("panromantic");
            this.aromantic      = this.target.Get("aromantic");
        }
Ejemplo n.º 3
0
        public bool Add(IRomance value)
        {
            if (this.RomanceTypes.ContainsKey(value.Name))
            {
                return(false);
            }

            this.RomanceTypes.Add(value.Name, value);
            return(true);
        }