Files
ft/Client/Assets/Scripts/UI/OfferSweep/EventSrategy/EventStrategyFactory.cs
2026-06-29 21:18:33 +08:00

35 lines
1.2 KiB
C#

using System.Collections.Generic;
namespace Assets.Scripts.UI.OfferSweep
{
public static class EventStrategyFactory
{
private static readonly Dictionary<int, IEventStrategy> Strategies = new Dictionary<int, IEventStrategy>
{
{ 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;
}
}
}