bb887b0901
* callbacks * controllers * Router override * make requests use interface * create Routers * extra parts
66 lines
1.8 KiB
C#
66 lines
1.8 KiB
C#
using Core.Annotations;
|
|
using Core.Callbacks;
|
|
using Core.DI;
|
|
using Core.Models.Eft.Common;
|
|
using Core.Utils;
|
|
|
|
namespace Core.Routers.Dynamic;
|
|
|
|
[Injectable(InjectableTypeOverride = typeof(DynamicRouter))]
|
|
public class BotDynamicRouter : DynamicRouter
|
|
{
|
|
protected static BotCallbacks _botCallbacks;
|
|
|
|
public BotDynamicRouter(
|
|
JsonUtil jsonUtil,
|
|
BotCallbacks botCallbacks
|
|
) : base(
|
|
jsonUtil,
|
|
[
|
|
new RouteAction(
|
|
"/singleplayer/settings/bot/limit/",
|
|
(
|
|
url,
|
|
info,
|
|
sessionID,
|
|
output
|
|
) => _botCallbacks.GetBotLimit(url, info as EmptyRequestData, sessionID)),
|
|
new RouteAction(
|
|
"/singleplayer/settings/bot/difficulty/",
|
|
(
|
|
url,
|
|
info,
|
|
sessionID,
|
|
output
|
|
) => _botCallbacks.GetBotDifficulty(url, info as EmptyRequestData, sessionID)),
|
|
new RouteAction(
|
|
"/singleplayer/settings/bot/difficulties",
|
|
(
|
|
url,
|
|
info,
|
|
sessionID,
|
|
output
|
|
) => _botCallbacks.GetAllBotDifficulties(url, info as EmptyRequestData, sessionID)),
|
|
new RouteAction(
|
|
"/singleplayer/settings/bot/maxCap",
|
|
(
|
|
url,
|
|
info,
|
|
sessionID,
|
|
output
|
|
) => _botCallbacks.GetBotCap(url, info as EmptyRequestData, sessionID)),
|
|
new RouteAction(
|
|
"/singleplayer/settings/bot/getBotBehaviours/",
|
|
(
|
|
url,
|
|
info,
|
|
sessionID,
|
|
output
|
|
) => _botCallbacks.GetBotBehaviours())
|
|
]
|
|
)
|
|
{
|
|
_botCallbacks = botCallbacks;
|
|
}
|
|
}
|