51 lines
2.2 KiB
C#
51 lines
2.2 KiB
C#
using System.Collections.Generic;
|
|
using Gamesmiths.Forge.Godot.Resources.Abilities;
|
|
using Godot;
|
|
using Movementtests.systems;
|
|
|
|
namespace Movementtests.managers;
|
|
|
|
[GlobalClass]
|
|
public partial class WeaponInventory(
|
|
ForgeAbilityBehavior[] onWeaponStartedFlyingAbilities,
|
|
ForgeAbilityBehavior[] onWeaponFlyingTickAbilities,
|
|
ForgeAbilityBehavior[] onWeaponStoppedFlyingAbilities,
|
|
ForgeAbilityBehavior[] onWeaponStartedPlantedAbilities,
|
|
ForgeAbilityBehavior[] onWeaponPlantedTickAbilities,
|
|
ForgeAbilityBehavior[] onWeaponStoppedPlantedAbilities
|
|
) : Resource
|
|
{
|
|
[ExportGroup("Flying abilities")]
|
|
[Export]
|
|
public ForgeAbilityBehavior[] OnWeaponStartedFlyingAbilities { get; set; } = onWeaponStartedFlyingAbilities;
|
|
[Export]
|
|
public ForgeAbilityBehavior[] OnWeaponFlyingTickAbilities { get; set; } = onWeaponFlyingTickAbilities;
|
|
[Export]
|
|
public ForgeAbilityBehavior[] OnWeaponStoppedFlyingAbilities { get; set; } = onWeaponStoppedFlyingAbilities;
|
|
|
|
[ExportGroup("Planted abilities")]
|
|
[Export]
|
|
public ForgeAbilityBehavior[] OnWeaponStartedPlantedAbilities { get; set; } = onWeaponStartedPlantedAbilities;
|
|
[Export]
|
|
public ForgeAbilityBehavior[] OnWeaponPlantedTickAbilities { get; set; } = onWeaponPlantedTickAbilities;
|
|
[Export]
|
|
public ForgeAbilityBehavior[] OnWeaponStoppedPlantedAbilities { get; set; } = onWeaponStoppedPlantedAbilities;
|
|
|
|
public WeaponInventory() : this([], [], [], [], [], [])
|
|
{
|
|
}
|
|
|
|
public Dictionary<WeaponSystem.WeaponEvent, ForgeAbilityBehavior[]> GetEventAbilitiesMap()
|
|
{
|
|
return new Dictionary<WeaponSystem.WeaponEvent, ForgeAbilityBehavior[]>
|
|
{
|
|
{ WeaponSystem.WeaponEvent.StartedFlying, OnWeaponStartedFlyingAbilities },
|
|
{ WeaponSystem.WeaponEvent.StoppedFlying, OnWeaponStoppedFlyingAbilities },
|
|
{ WeaponSystem.WeaponEvent.FlyingTick, OnWeaponFlyingTickAbilities },
|
|
|
|
{ WeaponSystem.WeaponEvent.StartedPlanted, OnWeaponStartedPlantedAbilities },
|
|
{ WeaponSystem.WeaponEvent.StoppedPlanted, OnWeaponStoppedPlantedAbilities },
|
|
{ WeaponSystem.WeaponEvent.PlantedTick, OnWeaponPlantedTickAbilities },
|
|
};
|
|
}
|
|
} |