Skip to content

Commit

Permalink
Moved attributes to Stats folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
afritz1 committed Nov 19, 2024
1 parent b003c9f commit c976fd7
Show file tree
Hide file tree
Showing 24 changed files with 378 additions and 377 deletions.
25 changes: 14 additions & 11 deletions OpenTESArena/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,12 @@ SET(TES_COLLISION
"${SRC_ROOT}/Collision/SelectionUtils.h")

SET(TES_ENTITIES
"${SRC_ROOT}/Entities/AttributeModifier.cpp"
"${SRC_ROOT}/Entities/AttributeModifier.h"
"${SRC_ROOT}/Entities/AttributeModifierName.h"
"${SRC_ROOT}/Entities/CharacterClassDefinition.cpp"
"${SRC_ROOT}/Entities/CharacterClassDefinition.h"
"${SRC_ROOT}/Entities/CharacterClassLibrary.cpp"
"${SRC_ROOT}/Entities/CharacterClassLibrary.h"
"${SRC_ROOT}/Entities/CitizenUtils.cpp"
"${SRC_ROOT}/Entities/CitizenUtils.h"
"${SRC_ROOT}/Entities/DerivedAttribute.cpp"
"${SRC_ROOT}/Entities/DerivedAttribute.h"
"${SRC_ROOT}/Entities/DerivedAttributeName.h"
"${SRC_ROOT}/Entities/EntityAnimationDefinition.cpp"
"${SRC_ROOT}/Entities/EntityAnimationDefinition.h"
"${SRC_ROOT}/Entities/EntityAnimationInstance.cpp"
Expand Down Expand Up @@ -171,11 +165,6 @@ SET(TES_ENTITIES
"${SRC_ROOT}/Entities/EntityVisibilityChunkManager.h"
"${SRC_ROOT}/Entities/Player.cpp"
"${SRC_ROOT}/Entities/Player.h"
"${SRC_ROOT}/Entities/PrimaryAttribute.cpp"
"${SRC_ROOT}/Entities/PrimaryAttribute.h"
"${SRC_ROOT}/Entities/PrimaryAttributeName.h"
"${SRC_ROOT}/Entities/PrimaryAttributeSet.cpp"
"${SRC_ROOT}/Entities/PrimaryAttributeSet.h"
"${SRC_ROOT}/Entities/WeaponAnimation.cpp"
"${SRC_ROOT}/Entities/WeaponAnimation.h")

Expand Down Expand Up @@ -488,6 +477,19 @@ SET(TES_SKY
"${SRC_ROOT}/Sky/SkyVisibilityManager.cpp"
"${SRC_ROOT}/Sky/SkyVisibilityManager.h")

SET(TES_STATS
"${SRC_ROOT}/Stats/AttributeModifier.cpp"
"${SRC_ROOT}/Stats/AttributeModifier.h"
"${SRC_ROOT}/Stats/AttributeModifierName.h"
"${SRC_ROOT}/Stats/DerivedAttribute.cpp"
"${SRC_ROOT}/Stats/DerivedAttribute.h"
"${SRC_ROOT}/Stats/DerivedAttributeName.h"
"${SRC_ROOT}/Stats/PrimaryAttribute.cpp"
"${SRC_ROOT}/Stats/PrimaryAttribute.h"
"${SRC_ROOT}/Stats/PrimaryAttributeName.h"
"${SRC_ROOT}/Stats/PrimaryAttributeSet.cpp"
"${SRC_ROOT}/Stats/PrimaryAttributeSet.h")

SET(TES_TIME
"${SRC_ROOT}/Time/ArenaClockUtils.cpp"
"${SRC_ROOT}/Time/ArenaClockUtils.h"
Expand Down Expand Up @@ -674,6 +676,7 @@ SET(TES_SOURCES
${TES_MATH}
${TES_RENDERING}
${TES_SKY}
${TES_STATS}
${TES_TIME}
${TES_UI}
${TES_UTILITIES}
Expand Down
2 changes: 1 addition & 1 deletion OpenTESArena/src/Entities/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "CharacterClassDefinition.h"
#include "CharacterClassLibrary.h"
#include "Player.h"
#include "PrimaryAttributeName.h"
#include "../Collision/CollisionChunk.h"
#include "../Collision/CollisionChunkManager.h"
#include "../Collision/Physics.h"
Expand All @@ -22,6 +21,7 @@
#include "../Math/Constants.h"
#include "../Math/Quaternion.h"
#include "../Math/Random.h"
#include "../Stats/PrimaryAttributeName.h"
#include "../Voxels/VoxelChunkManager.h"
#include "../World/CardinalDirection.h"

Expand Down
2 changes: 1 addition & 1 deletion OpenTESArena/src/Entities/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
#include "Jolt/Physics/Character/CharacterVirtual.h"
#include "Jolt/Physics/PhysicsSystem.h"

#include "PrimaryAttributeSet.h"
#include "WeaponAnimation.h"
#include "../Assets/MIFUtils.h"
#include "../Items/ItemInventory.h"
#include "../Math/MathUtils.h"
#include "../Stats/PrimaryAttributeSet.h"
#include "../World/Coord.h"

class CharacterClassLibrary;
Expand Down
2 changes: 1 addition & 1 deletion OpenTESArena/src/Game/CharacterCreationState.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include <optional>
#include <string_view>

#include "../Entities/PrimaryAttributeSet.h"
#include "../Math/Random.h"
#include "../Stats/PrimaryAttributeSet.h"

class CharacterCreationState
{
Expand Down
2 changes: 1 addition & 1 deletion OpenTESArena/src/Interface/CharacterCreationUiModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include "../Assets/ArenaPaletteName.h"
#include "../Assets/TextAssetLibrary.h"
#include "../Entities/CharacterClassLibrary.h"
#include "../Entities/PrimaryAttribute.h"
#include "../Game/Game.h"
#include "../Stats/PrimaryAttribute.h"

#include "components/debug/Debug.h"
#include "components/utilities/String.h"
Expand Down
2 changes: 1 addition & 1 deletion OpenTESArena/src/Interface/CharacterCreationUiModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include <string>
#include <vector>

#include "../Entities/PrimaryAttribute.h"
#include "../Math/Vector2.h"
#include "../Stats/PrimaryAttribute.h"
#include "../UI/TextRenderUtils.h"

class CharacterClassDefinition;
Expand Down
6 changes: 2 additions & 4 deletions OpenTESArena/src/Interface/CharacterPanel.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
#include <map>
#include <vector>

#include "SDL.h"

#include "CharacterPanel.h"
#include "CharacterSheetUiController.h"
#include "CharacterSheetUiModel.h"
#include "CharacterSheetUiView.h"
#include "CommonUiView.h"
#include "../Entities/PrimaryAttribute.h"
#include "../Entities/PrimaryAttributeName.h"
#include "../Game/Game.h"
#include "../Input/InputActionMapName.h"
#include "../Input/InputActionName.h"
#include "../Stats/PrimaryAttribute.h"
#include "../Stats/PrimaryAttributeName.h"
#include "../UI/CursorData.h"
#include "../UI/FontLibrary.h"

Expand Down
2 changes: 1 addition & 1 deletion OpenTESArena/src/Interface/CharacterSheetUiModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include "CharacterSheetUiModel.h"
#include "../Entities/CharacterClassLibrary.h"
#include "../Entities/PrimaryAttribute.h"
#include "../Game/Game.h"
#include "../Stats/PrimaryAttribute.h"

#include "components/debug/Debug.h"

Expand Down
2 changes: 1 addition & 1 deletion OpenTESArena/src/Interface/CharacterSheetUiModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <string>
#include <vector>

#include "../Entities/PrimaryAttribute.h"
#include "../Stats/PrimaryAttribute.h"

class Game;

Expand Down
4 changes: 2 additions & 2 deletions OpenTESArena/src/Interface/CharacterSheetUiView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#include "../Assets/ArenaPortraitUtils.h"
#include "../Assets/ArenaTextureName.h"
#include "../Entities/CharacterClassLibrary.h"
#include "../Entities/PrimaryAttribute.h"
#include "../Entities/PrimaryAttributeName.h"
#include "../Game/Game.h"
#include "../Stats/PrimaryAttribute.h"
#include "../Stats/PrimaryAttributeName.h"

TextBox::InitInfo CharacterSheetUiView::getPlayerNameTextBoxInitInfo(const std::string_view text,
const FontLibrary &fontLibrary)
Expand Down
4 changes: 2 additions & 2 deletions OpenTESArena/src/Interface/CharacterSheetUiView.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

#include "../Assets/TextureAsset.h"
#include "../Assets/TextureUtils.h"
#include "../Entities/PrimaryAttribute.h"
#include "../Entities/PrimaryAttributeName.h"
#include "../Math/Rect.h"
#include "../Math/Vector2.h"
#include "../Rendering/ArenaRenderUtils.h"
#include "../Rendering/RenderTextureUtils.h"
#include "../Stats/PrimaryAttribute.h"
#include "../Stats/PrimaryAttributeName.h"
#include "../UI/ArenaFontName.h"
#include "../UI/TextAlignment.h"
#include "../UI/TextBox.h"
Expand Down
4 changes: 2 additions & 2 deletions OpenTESArena/src/Interface/ChooseAttributesPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
#include "ChooseAttributesPanel.h"
#include "CommonUiView.h"
#include "TextSubPanel.h"
#include "../Entities/PrimaryAttribute.h"
#include "../Entities/PrimaryAttributeName.h"
#include "../Game/Game.h"
#include "../Input/InputActionName.h"
#include "../Stats/PrimaryAttribute.h"
#include "../Stats/PrimaryAttributeName.h"
#include "../UI/CursorData.h"
#include "../UI/FontLibrary.h"
#include "../UI/Surface.h"
Expand Down
2 changes: 1 addition & 1 deletion OpenTESArena/src/Interface/ChooseAttributesPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <vector>

#include "Panel.h"
#include "../Entities/PrimaryAttributeName.h"
#include "../Math/Vector2.h"
#include "../Stats/PrimaryAttributeName.h"
#include "../UI/Button.h"
#include "../UI/TextBox.h"

Expand Down
44 changes: 22 additions & 22 deletions ...SArena/src/Entities/AttributeModifier.cpp → OpenTESArena/src/Stats/AttributeModifier.cpp
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#include <unordered_map>

#include "AttributeModifier.h"
#include "AttributeModifierName.h"

// @todo: very old, replace this with ExeData.
const std::unordered_map<AttributeModifierName, std::string> AttributeModifierDisplayNames =
{
{ AttributeModifierName::MeleeDamage, "Melee Damage" },
{ AttributeModifierName::MagicDefense, "Magic Defense" },
{ AttributeModifierName::ToHit, "To Hit" },
{ AttributeModifierName::ToDefense, "To Defense" },
{ AttributeModifierName::HealthPerLevel, "Health Per Level" },
{ AttributeModifierName::HealModifier, "Heal Modifier" },
{ AttributeModifierName::Charisma, "Charisma" }
};

const std::string &AttributeModifier::toString(AttributeModifierName modifierName)
{
const std::string &displayName = AttributeModifierDisplayNames.at(modifierName);
return displayName;
}
#include <unordered_map>

#include "AttributeModifier.h"
#include "AttributeModifierName.h"

// @todo: very old, replace this with ExeData.
const std::unordered_map<AttributeModifierName, std::string> AttributeModifierDisplayNames =
{
{ AttributeModifierName::MeleeDamage, "Melee Damage" },
{ AttributeModifierName::MagicDefense, "Magic Defense" },
{ AttributeModifierName::ToHit, "To Hit" },
{ AttributeModifierName::ToDefense, "To Defense" },
{ AttributeModifierName::HealthPerLevel, "Health Per Level" },
{ AttributeModifierName::HealModifier, "Heal Modifier" },
{ AttributeModifierName::Charisma, "Charisma" }
};

const std::string &AttributeModifier::toString(AttributeModifierName modifierName)
{
const std::string &displayName = AttributeModifierDisplayNames.at(modifierName);
return displayName;
}
32 changes: 16 additions & 16 deletions ...TESArena/src/Entities/AttributeModifier.h → OpenTESArena/src/Stats/AttributeModifier.h
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#ifndef ATTRIBUTE_MODIFIER_H
#define ATTRIBUTE_MODIFIER_H

#include <string>

enum class AttributeModifierName;

// This namespace is just for toString() purposes. Obtaining the modifier value is a
// simple function, and can be done in the PrimaryAttribute class because it's the same
// for all modifiers.
namespace AttributeModifier
{
const std::string &toString(AttributeModifierName modifierName);
}

#endif
#ifndef ATTRIBUTE_MODIFIER_H
#define ATTRIBUTE_MODIFIER_H

#include <string>

enum class AttributeModifierName;

// This namespace is just for toString() purposes. Obtaining the modifier value is a
// simple function, and can be done in the PrimaryAttribute class because it's the same
// for all modifiers.
namespace AttributeModifier
{
const std::string &toString(AttributeModifierName modifierName);
}

#endif
56 changes: 28 additions & 28 deletions ...rena/src/Entities/AttributeModifierName.h → ...ESArena/src/Stats/AttributeModifierName.h
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
#ifndef ATTRIBUTE_MODIFIER_NAME_H
#define ATTRIBUTE_MODIFIER_NAME_H

// A unique identifier for each [-5, 5] attribute modifier.
// The new design will use tooltips on the attributes instead of showing them
// directly with the other attributes.
// Carry weight is not included because it's not a [-5, 5] value.
enum class AttributeModifierName
{
// Strength
MeleeDamage,

// Willpower
MagicDefense,

// Agility
ToHit,
ToDefense,

// Endurance
HealthPerLevel,
HealModifier,

// Personality
Charisma
};

#endif
#ifndef ATTRIBUTE_MODIFIER_NAME_H
#define ATTRIBUTE_MODIFIER_NAME_H

// A unique identifier for each [-5, 5] attribute modifier.
// The new design will use tooltips on the attributes instead of showing them
// directly with the other attributes.
// Carry weight is not included because it's not a [-5, 5] value.
enum class AttributeModifierName
{
// Strength
MeleeDamage,

// Willpower
MagicDefense,

// Agility
ToHit,
ToDefense,

// Endurance
HealthPerLevel,
HealModifier,

// Personality
Charisma
};

#endif
Loading

0 comments on commit c976fd7

Please sign in to comment.