You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Babushka/scripts/CSharp/GameEntity/Entities/VesnaEntity.cs

36 lines
1.1 KiB

using System;
using Babushka.scripts.CSharp.Common.Farming;
using Babushka.scripts.CSharp.Common.Inventory;
using Babushka.scripts.CSharp.GameEntity.Management;
using Godot;
namespace Babushka.scripts.CSharp.GameEntity.Entities;
public class VesnaEntity : PositionalEntity
{
public override string EntityType => OWN_TYPE_NAME;
public const string OWN_TYPE_NAME = "VesnaEntity";
public readonly InventoryInstance inventory = new (37);
public event Action<int>? SlotIndexChanged;
private int _currentSelectedSlotIndex;
public int CurrentSelectedSlotIndex
{
get => _currentSelectedSlotIndex;
set
{
if (value >= 0 && value <= 8)
{
_currentSelectedSlotIndex = value;
SlotIndexChanged?.Invoke(_currentSelectedSlotIndex);
}
}
}
public override void InstantiateEntityNode(Node2D parent)
{
var node = (VesnaBehaviour2D) EntityManager.Instance.NodeCreator.InstantiateNode(OWN_TYPE_NAME);
node.player2d.Initialize(this);
parent.AddChild(node);
}
}