37 lines
1.0 KiB
C#
37 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Godot;
|
|
using Movementtests.systems;
|
|
|
|
namespace Movementtests.managers;
|
|
|
|
public partial class WeaponEventInventoryChangedData(WeaponSystem.WeaponEvent forEvent, string abilityName)
|
|
: RefCounted
|
|
{
|
|
public WeaponSystem.WeaponEvent ForEvent { get; private set; } = forEvent;
|
|
public string Ability { get; private set; } = abilityName;
|
|
}
|
|
|
|
public partial class InventoryManager : Node
|
|
{
|
|
[Signal]
|
|
public delegate void InventoryChangedEventHandler();
|
|
|
|
[Signal]
|
|
public delegate void WeaponEventInventoryChangedEventHandler(WeaponEventInventoryChangedData data);
|
|
|
|
public Dictionary<string, Resource> Inventory { get; } = new();
|
|
|
|
public static InventoryManager Instance { get; private set; }
|
|
|
|
public override void _Ready()
|
|
{
|
|
Instance = this;
|
|
}
|
|
|
|
public void AddAbilityForWeaponEvent(WeaponSystem.WeaponEvent forEvent, string abilityName)
|
|
{
|
|
EmitSignalWeaponEventInventoryChanged(new WeaponEventInventoryChangedData(forEvent, abilityName));
|
|
}
|
|
}
|