PF-1: Add basic classes #1
@ -0,0 +1,38 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using NUnit.Framework;
|
||||||
|
using pflib_net.characters.internals.proficiencies;
|
||||||
|
|
||||||
|
namespace pflib_net.Tests.characters.internals.proficiencies;
|
||||||
|
|
||||||
|
[TestFixture]
|
||||||
|
[TestOf(typeof(ArmorProficiency))]
|
||||||
|
public class ArmorProficiencyTest
|
||||||
|
{
|
||||||
|
private Dictionary<ProficiencyType, int> _values = new()
|
||||||
|
{
|
||||||
|
{ ProficiencyType.Unarmored, 0},
|
||||||
|
{ ProficiencyType.LightArmor, 5 },
|
||||||
|
{ ProficiencyType.MediumArmor, 7 },
|
||||||
|
{ ProficiencyType.HeavyArmor, 9 }
|
||||||
|
};
|
||||||
|
|
||||||
|
private Dictionary<ProficiencyType, ProficiencyValue> _proficiencyValues =
|
||||||
|
new()
|
||||||
|
{
|
||||||
|
{ ProficiencyType.Unarmored, ProficiencyValue.None },
|
||||||
|
{ ProficiencyType.LightArmor, ProficiencyValue.Trained },
|
||||||
|
{ ProficiencyType.MediumArmor, ProficiencyValue.Expert },
|
||||||
|
{ ProficiencyType.HeavyArmor, ProficiencyValue.Master }
|
||||||
|
};
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[TestCase(ProficiencyType.Unarmored)]
|
||||||
|
[TestCase(ProficiencyType.LightArmor)]
|
||||||
|
[TestCase(ProficiencyType.MediumArmor)]
|
||||||
|
[TestCase(ProficiencyType.HeavyArmor)]
|
||||||
|
public void GetValueReturnsCorrectAc(ProficiencyType type)
|
||||||
|
{
|
||||||
|
var armorProficiency = new ArmorProficiency(_proficiencyValues);
|
||||||
|
Assert.That(armorProficiency.GetValue(type, 3), Is.EqualTo(_values[type]));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -10,8 +10,8 @@ public class PlayerCharacter : ICharacter
|
|||||||
private int Hp { get; set; }
|
private int Hp { get; set; }
|
||||||
private Stats Stats { get; set; }
|
private Stats Stats { get; set; }
|
||||||
private int Level { get; set; }
|
private int Level { get; set; }
|
||||||
private ArmorProficiency ArmorProficiency { get; set; }
|
private ArmorProficiency ArmorProficiency { get; }
|
||||||
private HashSet<ICondition> Conditions { get; set; } = new HashSet<ICondition>();
|
private HashSet<ICondition> _conditions = new();
|
||||||
|
|
||||||
public PlayerCharacter(int hp, Stats stats, int level, ArmorProficiency armorProficiency)
|
public PlayerCharacter(int hp, Stats stats, int level, ArmorProficiency armorProficiency)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4,7 +4,7 @@ namespace pflib_net.characters.internals.stats;
|
|||||||
|
|
||||||
public class Stats
|
public class Stats
|
||||||
{
|
{
|
||||||
private Dictionary<StatType, int> StatDict { get; set; } = new();
|
private Dictionary<StatType, int> StatDict { get; } = new();
|
||||||
|
|
||||||
public Stats(int strength, int dexterity, int constitution, int intelligence, int wisdom, int charisma)
|
public Stats(int strength, int dexterity, int constitution, int intelligence, int wisdom, int charisma)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user