// // Licensed under the MIT License. See LICENSE file in the project root for full license information. // namespace MUnique.OpenMU.DataModel.Configuration; using MUnique.OpenMU.Annotations; using MUnique.OpenMU.AttributeSystem; /// /// Defines a stat attribute, which may be increasable by the player. /// [Cloneable] public partial class StatAttributeDefinition { private AttributeDefinition? attribute = null!; /// /// Initializes a new instance of the class. /// public StatAttributeDefinition() { } /// /// Initializes a new instance of the class. /// /// The attribute. /// The base value. /// if set to true it is increasable by the player. public StatAttributeDefinition(AttributeDefinition attribute, float baseValue, bool increasableByPlayer) { this.attribute = attribute; this.BaseValue = baseValue; this.IncreasableByPlayer = increasableByPlayer; } /// /// Gets or sets the attribute definition of this stat attribute. /// #pragma warning disable S2292 // When this would be an auto property, it would lead to a virtual member call in the constructor. public virtual AttributeDefinition? Attribute #pragma warning restore S2292 { get { return this.attribute; } set { this.attribute = value; } } /// /// Gets or sets the base value, which is the initial value without an increase of the player. /// public float BaseValue { get; set; } /// /// Gets or sets a value indicating whether this stat is increasable by the player in any way. /// public bool IncreasableByPlayer { get; set; } /// public override string ToString() { return $"{this.Attribute}: {this.BaseValue}"; } }