summaryrefslogtreecommitdiff
path: root/scripts/map/Tile.cs
blob: c910b01dedd07cdde0ff7c014cfeb0513ce4baac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using Godot;
using System;

public partial class Tile : Sprite2D
{
	private TileDefinition definition;

	public bool IsWalkable { get; set; }

	public Tile(Vector2I pos, TileDefinition definition)
	{
		Centered = false;
		Position = Grid.GridToWorld(pos);
		SetDefinition(definition);
	}

	public void SetDefinition(TileDefinition definition) {
		this.definition = definition;
		Texture = definition.Texture;
		this.IsWalkable = definition.IsWalkable;
	}
}