// WingsEmu // // Developed by NosWings Team using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.DependencyInjection; using PhoenixLib.Configuration; using WingsEmu.Game._enum; using WingsEmu.Game.Configurations.Miniland; namespace WingsEmu.Plugins.BasicImplementations.Miniland; public static class DependencyInjectionExtensions { public static void AddMinilandModule(this IServiceCollection services) { services.AddFileConfiguration(new MinilandConfiguration { new() { MapVnum = (int)MapIds.MINILAND, RestrictedZones = new List { new() { RestrictionTag = RestrictionType.OnlyMates, Corner1 = new SerializablePosition { X = 2, Y = 7 }, Corner2 = new SerializablePosition { X = 17, Y = 8 } } }, ForcedPlacings = new List { new() { SubType = MinilandItemSubType.HOUSE, ForcedLocation = new SerializablePosition { X = 24, Y = 6 } }, new() { SubType = MinilandItemSubType.SMALL_HOUSE, ForcedLocation = new SerializablePosition { X = 21, Y = 4 } }, new() { SubType = MinilandItemSubType.WAREHOUSE, ForcedLocation = new SerializablePosition { X = 31, Y = 2 } } } } }); services.AddConfigurationsFromDirectory("minigame_scores"); services.AddConfigurationsFromDirectory("minigames"); services.AddFileConfiguration(); services.AddSingleton(s => new MinigameConfiguration { Minigames = s.GetRequiredService>().ToList(), ScoresHolders = s.GetRequiredService>().ToList(), Configuration = s.GetRequiredService() }); } }