Ejemplo n.º 1
0
        /// <summary>
        /// Creates a copy of <see cref="BackgroundModel"/>
        /// </summary>
        public BackgroundModel(BackgroundModel backgroundModel) : base(backgroundModel)
        {
            _skills = new List <Skill>(backgroundModel.Skills);

            _traits = new List <TraitModel>();
            foreach (TraitModel traitModel in backgroundModel.Traits)
            {
                _traits.Add(new TraitModel(traitModel));
            }

            _languagesIndex = _traits.FindIndex(x => x.TraitType == TraitType.Language);
            _toolsIndex     = _traits.FindIndex(x => x.TraitType == TraitType.Tool_Proficiency);
            _skillsIndex    = _traits.FindIndex(x => x.TraitType == TraitType.Skill_Proficiency);
            _startingIndex  = _traits.FindIndex(x => x.TraitType == TraitType.Starting_Proficiency);

            _xml = backgroundModel.XML;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a copy of <see cref="CharacterModel"/>
        /// </summary>
        public CharacterModel(CharacterModel characterModel) : base(characterModel)
        {
            _currentHP          = characterModel.CurrentHP;
            _tempHP             = characterModel.TempHP;
            _deathSaveSuccesses = characterModel.DeathSaveSuccesses;
            _deathSaveFailures  = characterModel.DeathSaveFailures;
            _race          = characterModel.Race != null ? new RaceModel(characterModel.Race) : null;
            _background    = characterModel.Background != null ? new BackgroundModel(characterModel.Background) : null;
            _alignment     = characterModel.Alignment;
            _movementModel = new MovementModel(characterModel.MovementModel);
            _inspiration   = characterModel.Inspiration;
            _deity         = characterModel.Deity;
            _gender        = characterModel.Gender;
            _age           = characterModel.Age;
            _heightFeet    = characterModel.HeightFeet;
            _heightInches  = characterModel.HeightInches;
            _weight        = characterModel.Weight;
            _hair          = characterModel.Hair;
            _eyes          = characterModel.Eyes;
            _skin          = characterModel.Skin;
            _experience    = characterModel.Experience;

            _baseStrength     = characterModel.BaseStrength;
            _baseDexterity    = characterModel.BaseDexterity;
            _baseConstitution = characterModel.BaseConstitution;
            _baseIntelligence = characterModel.BaseIntelligence;
            _baseWisdom       = characterModel.BaseWisdom;
            _baseCharisma     = characterModel.BaseCharisma;

            _bonusStrength     = characterModel.BonusStrength;
            _bonusDexterity    = characterModel.BonusDexterity;
            _bonusConstitution = characterModel.BonusConstitution;
            _bonusIntelligence = characterModel.BonusIntelligence;
            _bonusWisdom       = characterModel.BonusWisdom;
            _bonusCharisma     = characterModel.BonusCharisma;

            _personalityTraits = characterModel.PersonalityTraits;
            _ideals            = characterModel.Ideals;
            _bonds             = characterModel.Bonds;
            _flaws             = characterModel.Flaws;
            _backstory         = characterModel.Backstory;

            _levels = new List <LevelModel>();
            foreach (LevelModel levelModel in characterModel.Levels)
            {
                _levels.Add(new LevelModel(levelModel));
            }
            _abilityRollMethod        = characterModel.AbilityRollMethod;
            _timesAbilityScoresRolled = characterModel.TimesAbilityScoresRolled;

            _abilitySaveProficiencies = new List <AbilityModel>();
            foreach (AbilityModel abilityModel in characterModel.AbilitySaveProficiencies)
            {
                _abilitySaveProficiencies.Add(new AbilityModel(abilityModel));
            }

            _skillProficiencies = new List <SkillModel>();
            foreach (SkillModel skillModel in characterModel.SkillProficiencies)
            {
                _skillProficiencies.Add(new SkillModel(skillModel));
            }

            _languages = new List <LanguageModel>();
            foreach (LanguageModel languageModel in characterModel.Languages)
            {
                _languages.Add(new LanguageModel(languageModel));
            }

            _armorProficiencyModel  = new ArmorProficiencyModel(characterModel.ArmorProficiency);
            _weaponProficiencyModel = new WeaponProficiencyModel(characterModel.WeaponProficiency);
            _toolProficiencyModel   = new ToolProficiencyModel(characterModel.ToolProficiency);

            _conditions = new List <AppliedConditionModel>();
            foreach (AppliedConditionModel appliedCondition in characterModel.Conditions)
            {
                _conditions.Add(new AppliedConditionModel(appliedCondition));
            }

            _savingThrowNotes = characterModel.SavingThrowNotes;

            _attacks = new List <AttackModel>();
            foreach (AttackModel attackModel in characterModel.Attacks)
            {
                _attacks.Add(new AttackModel(attackModel));
            }

            _counters = new List <CounterModel>();
            foreach (CounterModel counter in characterModel.Counters)
            {
                _counters.Add(new CounterModel(counter));
            }

            _companions = new List <CompanionModel>();
            foreach (CompanionModel companion in characterModel.Companions)
            {
                _companions.Add(new CompanionModel(companion));
            }

            _bags = new List <BagModel>();
            foreach (BagModel bag in characterModel.Bags)
            {
                _bags.Add(new BagModel(bag));
            }

            _spellbooks = new List <SpellbookModel>();
            foreach (SpellbookModel spellbook in characterModel.Spellbooks)
            {
                _spellbooks.Add(new SpellbookModel(spellbook));
            }

            _statModifications = new List <StatModificationModel>();
            foreach (StatModificationModel statModification in characterModel.StatModifications)
            {
                _statModifications.Add(new StatModificationModel(statModification));
            }

            _armorClassModel = new ArmorClassModel(characterModel.ArmorClassModel);
        }