public static void Start(MonoBehaviour launcher, IGameTemplate game) { Engine.launcher = launcher; activegame = game; activegame.Start(); foreach (var o in Objects) { o.Start(); } }
private async Task HandleMessage(SocketMessage Message) { if (!FunConfiguration.GamesChannels.Contains(Message.Channel.Id) && Message.Channel is not IDMChannel) { return; } if (Message.Content.StartsWith(BotConfiguration.Prefix)) { return; } Player Player = GamesDB.Players.Find(Message.Author.Id); if (Player is null) { return; } if (Player.Playing < 1) { return; } GameInstance Instance = GamesDB.Games.Find(Player.Playing); if (Instance is null) { return; } IGameTemplate Game = Instance.ToGameProper(); if (Game is null) { return; } await Game.HandleMessage(Message, GamesDB, DiscordSocketClient, FunConfiguration); }