2024-01-11 21:00:48 -05:00
|
|
|
using Godot;
|
|
|
|
using GodotGridInventory.Code.Grid.Enums;
|
2024-01-14 00:30:09 -05:00
|
|
|
using GodotGridInventory.Code.UI;
|
2024-01-11 21:00:48 -05:00
|
|
|
|
|
|
|
namespace GodotGridInventory.Code.Grid;
|
|
|
|
|
2024-01-11 23:52:01 -05:00
|
|
|
#nullable enable
|
2024-01-11 21:00:48 -05:00
|
|
|
public class InventoryCell
|
|
|
|
{
|
|
|
|
private readonly InventoryGrid _parentGrid;
|
|
|
|
public Vector2 Position { get; set; }
|
|
|
|
public EnumInventoryGridCellState State { get; set; }
|
2024-01-11 23:52:01 -05:00
|
|
|
public Item? Item { get; set; } = null;
|
2024-01-14 00:30:09 -05:00
|
|
|
public InventoryGridItem? ItemGraphic { get; set; } = null;
|
2024-01-11 21:00:48 -05:00
|
|
|
|
|
|
|
|
|
|
|
public InventoryCell(Vector2 position, InventoryGrid parentGrid)
|
|
|
|
{
|
|
|
|
_parentGrid = parentGrid;
|
|
|
|
State = EnumInventoryGridCellState.Available;
|
|
|
|
Item = null;
|
|
|
|
Position = position;
|
2024-01-11 23:52:01 -05:00
|
|
|
GD.Print($"Inventory cell created at position {position.X}, {position.Y}");
|
2024-01-11 21:00:48 -05:00
|
|
|
}
|
|
|
|
}
|