using System.Collections.Generic; namespace Assets.Scripts.UI.OfferSweep { public static class EventStrategyFactory { private static readonly Dictionary Strategies = new Dictionary { { 1, new SandDigStrategy() }, { 5, new PotionEventStrategy() }, { 6, new EventPinballStrategy() }, { 7, new EventBingoStrategy() }, // { 8, new EventPartnerGatherStrategy()}, { 9, new EventJigsawPuzzleStrategy() }, // {11 ,new EventCubeMeltStrategy()}, {16, new EventCubeMeltStrategy()}, { 12, new EventBossFightStrategy() }, { 13, new EventMatchStrategy() }, { 14,new EventPinballCountlessStrategy()} }; public static bool IsRegisterEventBySubType(int subType) { return Strategies.ContainsKey(subType); } public static IEventStrategy GetStrategy(int subType) { return Strategies.GetValueOrDefault(subType); } public static void RegisterStrategy(int subType, IEventStrategy strategy) { Strategies[subType] = strategy; } } }