blob: 7fd80d4a2423d874a624d37c5c09092c1f737b2c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
using Godot;
using TheLegendOfGustav.Map;
namespace TheLegendOfGustav.Entities.Actors;
/// <summary>
/// Classe do jogador. Por enquanto não é diferente do Ator, mas isso pode mudar.
/// </summary>
[GlobalClass]
public partial class Player : Actor
{
public Player(Vector2I initialPosition, MapData map, PlayerDefinition definition) : base(initialPosition, map, definition)
{
Definition = definition;
SetDefinition(definition);
}
private PlayerDefinition Definition { get; set; }
public Inventory Inventory { get; private set; }
public void SetDefinition(PlayerDefinition definition)
{
Inventory = new(definition.InventoryCapacity);
AddChild(Inventory);
}
}
|