public Form1() { InitializeComponent(); Activated += Form1_Activated; keyControlTextBox.KeyUp += Form1_KeyDown; Text = AppSettings.IsProd ? AppSettings.User.ToString() : "Test"; Task.Run(InitSettings); InitFieldPanel(); InitPredictionCheckboxes(); // Creating custom AI client var bot = new YourSolver(AppSettings.IsProd ? AppSettings.ServerURL : AppSettings.TestServerURL); bot.RoundCallbackHandler += SetBoard; Logger.LoggerTextBox = logTextBox; ChangeFieldItem += Form1_ChangeFieldItem; // Starting thread with playing game Task.Run(bot.Play); }
void Start() { //Console.SetWindowSize(Console.LargestWindowWidth - 3, Console.LargestWindowHeight - 3); // creating custom AI client bot = new YourSolver(ServerUrl); // starting thread with playing game (new Thread(bot.Play)).Start(); bot.BoardUpdated += UpdateBoardInvoke; }
public void ShouldSomething() { YourSolver d = new YourSolver("any server"); Board b = new Board("any board"); string firstStep = d.Get(b); Assert.AreEqual("Up", firstStep); string secondStep = d.Get(b); Assert.AreEqual("Up", secondStep); string thirdStep = d.Get(b); Assert.AreEqual("Up", thirdStep); }