Interface ILevelable
- Namespace
- ElectricDrill.SoapRpgFramework.Experience
- Assembly
- com.electricdrill.soap-rpg-framework.Runtime.dll
Interface for entities that have a leveling system based on experience points. Provides the core functionality for level progression and experience management.
public interface ILevelable
Properties
CurrentTotalExperience
Gets the current total experience of the entity. This represents all experience gained since creation.
long CurrentTotalExperience { get; }
Property Value
- long
Level
Gets or sets the current level of the entity. Setting the level may trigger level-up events and related effects.
int Level { get; set; }
Property Value
- int
Methods
AddExp(long)
Adds experience points to the entity. May cause the entity to level up if enough experience is gained.
void AddExp(long amount)
Parameters
amountlongThe amount of experience to add.
CurrentLevelTotalExperience()
Gets the total experience required to reach the current level.
long CurrentLevelTotalExperience()
Returns
- long
The experience threshold for the current level.
NextLevelTotalExperience()
Gets the total experience required to reach the next level.
long NextLevelTotalExperience()
Returns
- long
The experience threshold for the next level.
SetTotalCurrentExp(long)
Sets the total current experience and updates the level accordingly. The level will be recalculated based on the new experience total.
void SetTotalCurrentExp(long totalCurrentExperience)
Parameters
totalCurrentExperiencelongThe total experience to set.
ValidateExperience()
Validates that the current experience matches the current level. Used for debugging and ensuring data consistency.
void ValidateExperience()