Show / Hide Table of Contents

    Class Stat

    Class that represents a stat.

    Inheritance
    System.Object
    Stat
    Implements
    IStat
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Fibula.Creatures
    Assembly: Fibula.Creatures.dll
    Syntax
    public class Stat : IStat

    Constructors

    | Improve this Doc View Source

    Stat(CreatureStat, UInt32, UInt32)

    Initializes a new instance of the Stat class.

    Declaration
    public Stat(CreatureStat statType, uint currentValue, uint maxValue)
    Parameters
    Type Name Description
    CreatureStat statType

    The stat type.

    System.UInt32 currentValue

    The current stat value.

    System.UInt32 maxValue

    The maximum value that the stat can reach.

    Properties

    | Improve this Doc View Source

    Current

    Gets this stat's current value.

    Declaration
    public uint Current { get; }
    Property Value
    Type Description
    System.UInt32
    | Improve this Doc View Source

    Maximum

    Gets this stat's maximum value.

    Declaration
    public uint Maximum { get; }
    Property Value
    Type Description
    System.UInt32
    | Improve this Doc View Source

    Percent

    Gets the current percentual value between current and maximum values.

    Declaration
    public byte Percent { get; }
    Property Value
    Type Description
    System.Byte
    | Improve this Doc View Source

    Type

    Gets this stat's id.

    Declaration
    public CreatureStat Type { get; }
    Property Value
    Type Description
    CreatureStat

    Methods

    | Improve this Doc View Source

    Decrease(Int32)

    Decreases this stats's value.

    Declaration
    public bool Decrease(int value)
    Parameters
    Type Name Description
    System.Int32 value

    The amount by which to decrease this stat's value.

    Returns
    Type Description
    System.Boolean

    True if the value was actually decreased, false otherwise.

    | Improve this Doc View Source

    Increase(Int32)

    Increases this stats's value.

    Declaration
    public bool Increase(int value)
    Parameters
    Type Name Description
    System.Int32 value

    The amount by which to increase this stat's value.

    Returns
    Type Description
    System.Boolean

    True if the value was actually increased, false otherwise.

    | Improve this Doc View Source

    Set(UInt32)

    Sets this stats's value.

    Declaration
    public bool Set(uint value)
    Parameters
    Type Name Description
    System.UInt32 value

    The value to set in the stat. This is bounded by [0, Maximum].

    Returns
    Type Description
    System.Boolean

    True if the value was actually changed, false otherwise.

    Events

    | Improve this Doc View Source

    Changed

    Event triggered when this stat changes.

    Declaration
    public event OnStatChanged Changed
    Event Type
    Type Description
    OnStatChanged

    Implements

    IStat

    Extension Methods

    ObjectExtensions.YieldSingleItem<T>(T)
    ObjectExtensions.GetPropertyValue(Object, String)
    Validate.ThrowIfNull(Object, String)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2018-2020 | The Fibula Project
    Generated using DocFX | Jose L. Nuñez de Caceres et al.