new forge entity node to benefit from autoinject

This commit is contained in:
2026-05-02 15:24:28 +02:00
parent fb30a08b89
commit 0e6211943d
12 changed files with 134 additions and 99 deletions

View File

@@ -20,6 +20,7 @@ using Godot;
using GodotStateCharts;
using Movementtests.addons.godot_state_charts.csharp;
using Movementtests.interfaces;
using Movementtests.tools;
using Node = Godot.Node;
namespace Movementtests.systems;
@@ -90,13 +91,14 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
#endregion
#region Publics
public EntityAttributes Attributes { get; set; } = null!;
public EntityTags Tags { get; set; } = null!;
public EffectsManager EffectsManager { get; set; } = null!;
public EntityAbilities Abilities { get; set; } = null!;
public EventManager Events { get; set; } = null!;
public Variables SharedVariables { get; }
public required EntityAttributes Attributes { get; set; }
public required EntityTags Tags { get; set; }
public required EffectsManager EffectsManager { get; set; }
public required EntityAbilities Abilities { get; set; }
public required EventManager Events { get; set; }
public required Variables SharedVariables { get; set; }
public StateChartState InHandState = null!;
public StateChartState FlyingState = null!;
@@ -176,16 +178,7 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
WeaponFlyingAbilityTag = Tag.RequestTag(tagsManager,"abilities.weapon.flying");
List<AttributeSet> attributeSetList = [];
foreach (var node in GetChildren())
{
if (node is not ForgeAttributeSet attributeSetNode) continue;
var attributeSet = attributeSetNode.GetAttributeSet();
if (attributeSet is not null)
attributeSetList.Add(attributeSet);
}
Attributes = new EntityAttributes([.. attributeSetList]);
Attributes = new EntityAttributes([.. ForgeUtils.CollectAttributeList(this)]);
Tags = new(BaseTags.GetTagContainer());
EffectsManager = new EffectsManager(this, cuesManager);
Abilities = new(this);