using Godot; using System; using System.Collections.Generic; using System.Linq; /// /// 实验室场景主控脚本 /// public partial class Lab : Node2D { /// /// 地图节点类型标志位 /// [Flags] public enum MapNodeType { Invalid = 0, // 无效 Walkable = 1, // 可行走 Wall = 2, // 墙壁 Blocker = 4, // 阻挡物 SeatUp = 8, // 上方座位 SeatDown = 16, // 下方座位 } // 墙壁矩形区域列表 private static readonly Rect2I[] wallRectangles = { new(0,0,40,2), new(0,5,1, 15), new(0,20,40,1), new(39,2,1,18), }; private readonly Dictionary _furnitureIDs = new(); /// /// 家具字典,通过ID索引 /// public Dictionary Furniture => _furnitureIDs; // Called when the node enters the scene tree for the first time. /// /// 场景加载完成时调用 /// public override void _Ready() { var ticker = GetNode("/root/GameManager/OneSecondTicker"); Player.Timeline.Attach(ticker); Player.Timeline.Subscribe(DateOnly.Parse("2024/11/20"), Guid.NewGuid()); Player.Timeline.OnEventTriggered += (d, e) => GD.Print($"Timeline event triggered: {d}, {e}"); var label = GetNode