using Chickensoft.AutoInject; using Chickensoft.GodotNodeInterfaces; using Chickensoft.Introspection; using DialogueManagerRuntime; using Godot; using System.Collections.Generic; using System.Linq; namespace GameJamDungeon; public interface IMap : INode3D { public List Floors { get; } public Vector3 GetPlayerSpawnPoint(); } [Meta(typeof(IAutoNode))] public partial class Map : Node3D, IMap { public override void _Notification(int what) => this.Notify(what); [Node] public Area3D Teleport { get; set; } = default!; public List Floors { get; set; } = default!; private IDungeonFloor _currentFloor; public void Setup() { Floors = GetChildren().OfType().ToList(); _currentFloor = Floors.ElementAt(0); Teleport.BodyEntered += OnTeleportEntered; } public Vector3 GetPlayerSpawnPoint() { return _currentFloor.GetPlayerSpawnPoint(); } private void OnTeleportEntered(Node3D body) { DialogueManager.GetCurrentScene = (() => this); var dialogueResource = GD.Load("res://src/ui/dialogue/FloorExit.dialogue"); DialogueController.ShowDialogue(dialogueResource, "floor_exit"); } }