Skip to content

Added ability to remove an Attribute Set from an entity. - #62

Open
lextatic wants to merge 12 commits into
mainfrom
feature/remove-attribute-set
Open

Added ability to remove an Attribute Set from an entity.#62
lextatic wants to merge 12 commits into
mainfrom
feature/remove-attribute-set

Conversation

@lextatic

Copy link
Copy Markdown
Contributor

Added

  • Added RemoveAttributeSet method to EntityAttributes.

@lextatic lextatic added the added New features label Aug 11, 2026
@lextatic
lextatic requested a balanced review from Copilot August 11, 2026 01:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds runtime removal and re-addition of entity attribute sets while preserving active-effect behavior and listener subscriptions.

Changes:

  • Adds attribute-set removal, lookup, and membership events.
  • Rebuilds effects and rebinds attribute listeners/components after membership changes.
  • Adds tests and documentation for the new lifecycle.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
Forge/Core/EntityAttributes.cs Implements set membership management.
Forge/Effects/ActiveEffect.cs Rebuilds active effects.
Forge/Effects/EffectEvaluatedData.cs Refreshes captured attributes.
Forge/Effects/EffectsManager.cs Coordinates effect rebuilding.
Forge/Effects/Components/IEffectComponent.cs Adds membership-change callback.
Forge/Effects/Components/AttributeRequirementsEffectComponent.cs Rebinds target requirements.
Forge/Effects/Components/SourceAttributeRequirementsEffectComponent.cs Rebinds source requirements.
Forge/Effects/Components/AttributeAccumulatorEffectComponent.cs Rebinds accumulator tracking.
Forge/Statescript/Nodes/State/AttributeListenerNode.cs Follows replaced attributes.
Forge/Statescript/Nodes/State/AttributeListenerNodeContext.cs Stores membership subscriptions.
Forge.Tests/Attributes/AttributeSetRemovalTests.cs Tests removal behavior.
Forge.Tests/Statescript/Nodes/State/ListenerNodesTests.cs Tests listener rebinding.
Forge.Tests/Effects/CustomCalculatorsEffectsTests.cs Updates construction API usage.
Forge.Tests/Helpers/TestEntity.cs Supplies the attribute owner.
Forge.Tests/Helpers/VitalTestEntity.cs Supplies the attribute owner.
Forge.Tests/Samples/QuickStartTests.cs Updates sample construction.
docs/attributes.md Documents runtime membership changes.
docs/effects/modifiers.md Documents missing-attribute modifiers.
docs/effects/components/attribute-requirements-effect-component.md Documents requirement rebinding.
docs/statescript/nodes/state/attribute-listener-node.md Documents listener rebinding.
docs/quick-start.md Updates initialization example.
Suppressed comments (1)

Forge/Core/EntityAttributes.cs:151

  • This flush runs while active effects and requirement components are still subscribed to the departing attributes. A notification can therefore call ReapplyEffect or remove an effect in the middle of RebuildAroundAttributeChange; the later rebuild then applies that effect again without undoing the callback's application, leaving duplicate or orphaned modifiers. Suspend the framework's capture/requirement subscriptions before unwinding and flushing, while preserving external listeners for this final notification, then rebind after detachment.
			foreach (EntityAttribute attribute in attributeSet.AttributesMap.Values)
			{
				attribute.ApplyPendingValueChanges();

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Forge/Effects/EffectsManager.cs Outdated
Comment thread Forge/Effects/ActiveEffect.cs
Comment thread Forge.Tests/Attributes/AttributeSetRemovalTests.cs Outdated
Comment thread Forge/Core/EntityAttributes.cs
Comment thread Forge/Effects/Components/AttributeRequirementsEffectComponent.cs
Comment thread Forge/Effects/EffectsManager.cs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

Comment thread Forge/Effects/ActiveEffect.cs
Comment thread Forge/Core/EntityAttributes.cs Outdated
Comment thread Forge/Core/EntityAttributes.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

added New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants