static void Main(string[] args) { var config = new ConfigurationBuilder() .AddJsonFile("appSettings.json", true, true) .Build(); var serviceProvider = new ServiceCollection() .AddEntityFrameworkNpgsql() .AddDbContext <TRDbContext>(options => options.UseNpgsql(config.GetConnectionString("default"))) .AddSingleton <IGame, Game>() .AddTransient <IEntityService, EntityService>() .AddTransient <IScriptService, ScriptService>() .AddTransient <IComponentService, ComponentService>() .AddTransient <ITemplateService, TemplateService>() .AddTransient <ITimedActionService, TimedActionService>() .AddTransient <ILocaleService, LocaleService>() .BuildServiceProvider(); var game = serviceProvider.GetService <IGame>(); game.Start(); var admin = new AdminConsole(game); while (game.IsRunning) { admin.HandleInput(Console.ReadLine()); } }
static void Main(string[] args) { var mkbot = new MonikaBot(); mkbot.MainAsync().GetAwaiter().GetResult(); // Just let it run in background while (!mkbot.IsReady) { // Wait for bot to be ready } AdminConsole admin = new AdminConsole(); admin.Client = mkbot.Client; admin.Generator = mkbot.Generator; admin.Manager = mkbot.Manager; Console.Write("> "); var cmd = Console.ReadLine(); while (cmd != "exit") { admin.ParseCommand(cmd); Console.Write("> "); cmd = Console.ReadLine(); } }
public static void Main(string[] args) { // Generate reversion pdo /* * var chr = new Character(); * chr.Name = "Sayori"; * chr.Avatar = "Data\\Sayori\\25.png"; * chr.Personality = "Data\\Sayori\\edgy.pdo"; * chr.Responses = new List<string>(); * chr.PdoFiles = new Dictionary<string, string>(); * chr.PdoFiles.Add("default", "Data\\Sayori\\edgy.pdo"); * chr.Emotions = new Dictionary<string, string>(); * chr.Emotions.Add("default", "Data\\Sayori\\25.png"); * var chr_json = JsonConvert.SerializeObject(chr, Formatting.Indented); * File.WriteAllText("sayoritest.pdo", chr_json); */ var mkbot = new MonikaBot(); mkbot.MainAsync().GetAwaiter().GetResult(); // Just let it run in background // I really hate doing this because it'll block main() entirely while the bot boots up in the background // There's alternative ways but I don't want to have to go back and forth between event handlers, yk? // We can maybe implement that in a future update while (!mkbot.IsReady) { // Wait for bot to be ready } AdminConsole admin = new AdminConsole(); admin.Client = mkbot.Client; admin.Generator = mkbot.Generator; admin.Personality = mkbot.Personality; Console.Write("> "); var cmd = Console.ReadLine(); while (cmd != "exit") { admin.ParseCommand(cmd); Console.Write("> "); cmd = Console.ReadLine(); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void picBoxAdmin_Click(object sender, EventArgs e) { AdminConsole admConsole = new AdminConsole(); admConsole.ShowDialog(); }