コード例 #1
0
        public void TestGetValue_NullValue()
        {
            CharacterScore characterScore = new CharacterScore(ScoreType.Fortitude);

            Assert.That(() => characterScore.GetValue(null),
                Throws.TypeOf<ArgumentNullException>().And.Property("ParamName").EqualTo("character"));
        }
コード例 #2
0
        public void TestGetValue()
        {
            CharacterScore characterScore = new CharacterScore(ScoreType.Fortitude);

            Assert.That(characterScore.GetValue(Level01Characters.Clip),
                Is.EqualTo(17));
        }
コード例 #3
0
        public void TestConstructor()
        {
            ScoreType scoreType = ScoreType.Fortitude;
            CharacterScore characterScore = new CharacterScore(scoreType);

            Assert.That(characterScore.ScoreType, Is.EqualTo(scoreType));
        }
コード例 #4
0
    // Add new character Score of a certain Character
    public void addCharacter(Character objectPointer)
    {
        objectPointer.OnDead.AddListener(CharacterDeadScoreHandler);
        objectPointer.OnDead.AddListener(ScoreDebug);
        CharacterScore newCharacterScore = new CharacterScore(objectPointer);

        characterScores.Add(newCharacterScore);
    }
コード例 #5
0
        /// <summary>
        /// Create a new <see cref="DiceDamageEffect"/>.
        /// </summary>
        /// <param name="target">
        /// The <see cref="Target"/> this effect component acts on. This
        /// cannot be null.
        /// </param>
        /// <param name="score">
        /// The <see cref="CharacterScore"/> that gains the bonus. This
        /// cannot be null.
        /// </param>
        /// <param name="modifier">
        /// A score that, when calculated, gives the bonus or penalty.
        /// </param>
        /// <param name="until">
        /// When the bonus ends.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// No argument can be null.
        /// </exception>
        public GainModifierEffect(Target target, CharacterScore score, ICharacterScoreValue modifier, Until until)
            : base(target)
        {
            if (score == null)
            {
                throw new ArgumentNullException("score");
            }
            if (modifier == null)
            {
                throw new ArgumentNullException("modifier");
            }

            this.Scores = new List<CharacterScore>(new [] { score });
            this.Modifier = modifier;
            this.Until = until;
        }
コード例 #6
0
 public void addCharacterScore(Character characterObject)
 {
     characterScore[numberOfCharacter] = new CharacterScore(characterObject);
     numberOfCharacter++;
 }
コード例 #7
0
 /// <summary>
 /// Create a new <see cref="DiceDamageEffect"/>.
 /// </summary>
 /// <param name="target">
 /// The <see cref="Target"/> this effect component acts on. This
 /// cannot be null.
 /// </param>
 /// <param name="score">
 /// The <see cref="CharacterScore"/> that gains the bonus. This
 /// cannot be null.
 /// </param>
 /// <param name="bonus">
 /// The amount of the bonus.
 /// </param>
 /// <param name="until">
 /// Then the bonus ends.
 /// </param>
 /// <exception cref="ArgumentNullException">
 /// No argument can be null.
 /// </exception>
 public GainModifierEffect(Target target, CharacterScore score, int bonus, Until until)
     : this(target, score, new ConstantValue(bonus), until)
 {
     // Do nothing
 }