The FCharacterSkill struct represents a skill of a character.
More...
#include <BaseData.h>
|
| FGameplayTag | Name = SkillTags::Strength |
| |
| int32 | Level = 1 |
| |
| float | XP = 0.0f |
| |
The FCharacterSkill struct represents a skill of a character.
- See also
- https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/StringHandling/FString/
This struct contains the properties necessary to define a character skill, such as the skill name, level, and experience points (XP). It also provides a method to add XP to the skill and level up the skill.
◆ FCharacterSkill() [1/3]
| FCharacterSkill::FCharacterSkill |
( |
| ) |
|
|
inline |
◆ FCharacterSkill() [2/3]
| FCharacterSkill::FCharacterSkill |
( |
const FGameplayTag | SkillName | ) |
|
|
inlineexplicit |
737 {
739 }
FGameplayTag Name
Definition BaseData.h:726
◆ FCharacterSkill() [3/3]
| FCharacterSkill::FCharacterSkill |
( |
const FGameplayTag | SkillName, |
|
|
const int32 | StartingLevel ) |
|
inlineexplicit |
741 {
743 Level = StartingLevel;
745 }
static int32 XP_PER_LEVEL
Definition BaseData.h:707
float XP
Definition BaseData.h:730
int32 Level
Definition BaseData.h:728
◆ AddLevel()
| bool FCharacterSkill::AddLevel |
( |
const bool | bIncrease | ) |
|
|
inline |
763 {
764 int32 PrevLevel =
Level;
765 if(bIncrease)
766 {
768 }
769 else
770 {
772 }
774 return Level != PrevLevel;
775 }
static int32 MIN_SKILL_LEVEL
Definition BaseData.h:708
static int32 MAX_SKILL_LEVEL
Definition BaseData.h:706
◆ AddXP()
| bool FCharacterSkill::AddXP |
( |
const float | Value | ) |
|
|
inline |
Doesn't go past Max skill level
- Parameters
-
- Returns
- if Leveled Up
752 {
755
756
758 return Level > LevelBefore;
759 }
◆ Level
| int32 FCharacterSkill::Level = 1 |
◆ Name
| FGameplayTag FCharacterSkill::Name = SkillTags::Strength |
◆ XP
| float FCharacterSkill::XP = 0.0f |
The documentation for this struct was generated from the following file:
- T:/Unreal/Unreal Projects/SpaceAdventure52/SpaceAdventure/Plugins/BaseHelpers/Source/BaseHelpers/Public/Data/BaseData.h