using System.Threading.Tasks; using ColdMint.scripts.map.interfaces; using ColdMint.scripts.serialization; using Godot; namespace ColdMint.scripts.map.roomInjectionProcessor; /// /// Room injection processor template /// 房间注入处理器模板 /// /// public abstract class RoomInjectionProcessorTemplate : IRoomInjectionProcessor { public abstract string GetId(); public Task CanBePlaced(RandomNumberGenerator randomNumberGenerator, string? yamlConfigData) { if (yamlConfigData == null) { return Task.FromResult(false); } var configData = YamlSerialization.Deserialize(yamlConfigData); return configData == null ? Task.FromResult(false) : OnCreateConfigData(randomNumberGenerator, configData); } /// /// When creating a configuration class /// 当创建配置类时 /// /// /// /// protected abstract Task OnCreateConfigData(RandomNumberGenerator randomNumberGenerator, TConfig configData); }