31 lines
669 B
C#
31 lines
669 B
C#
using RPGLibrary.Abstraction.Character;
|
|
|
|
namespace RPGLibrary.Implementation
|
|
{
|
|
public class Character : ICharacter
|
|
{
|
|
public Character(string name, HP hp, StrengthAttribute strength, DefenseAttribute defense)
|
|
{
|
|
Name = name;
|
|
HP = hp;
|
|
Strength = strength;
|
|
Defense = defense;
|
|
}
|
|
|
|
public string Name { get; }
|
|
|
|
public HP HP { get; private set; }
|
|
|
|
public StrengthAttribute Strength { get; }
|
|
|
|
public DefenseAttribute Defense { get; }
|
|
|
|
public override string? ToString()
|
|
{
|
|
return $"{HP}, {Strength}, {Defense}";
|
|
}
|
|
|
|
public ICharacter With(HP hp) => new Character(Name, hp, Strength, Defense);
|
|
}
|
|
|
|
} |