diff options
Diffstat (limited to 'scripts/DungeonLevel.cs')
| -rw-r--r-- | scripts/DungeonLevel.cs | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/scripts/DungeonLevel.cs b/scripts/DungeonLevel.cs deleted file mode 100644 index 68751c5..0000000 --- a/scripts/DungeonLevel.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Godot; -using System; - -public partial class DungeonLevel : Node2D -{ - private TileMapLayer buildingLayer; - public Godot.Collections.Array<Actor> Actors { get; private set; } = []; - - private Node2D actorsNode; - - public override void _Ready() - { - base._Ready(); - - buildingLayer = GetNode<TileMapLayer>("Dungeon"); - actorsNode = GetNode<Node2D>("Actors"); - } - - public void InsertActor(Actor actor) { - Actors.Add(actor); - actorsNode.AddChild(actor); - } - - public bool IsTileWalkable(Vector2I pos) { - TileData tile = buildingLayer.GetCellTileData(pos); - - if (tile == null) return false; - - return (bool)tile.GetCustomData("isWalkable"); - } - - public Actor GetBlockingActorAtPosition(Vector2I pos) { - foreach (Actor actor in Actors) { - if (actor.GridPosition == pos && actor.BlocksMovement) { - return actor; - } - } - return null; - } -} |
