Example #1
0
 public void OnePlace()
 {
     Bot1.PositionTo(Battlefield, 0, 0);
     Bot2.PositionTo(Battlefield, 1, 0);
     Bot1.DistanceTo(Bot2.InsideView).Should().Be(1);
     Bot1.DistanceTo(Bot2.OutsideView).Should().Be(1);
 }
Example #2
0
        public BotRunner()
        {
            var botTemp = new Bot2();

            botTemp.BotProfile = BotProfile.GetBotProfileFromDb();
            bot = botTemp;

            authentication = new AuthenticationService();
        }
Example #3
0
        private void FrmMain_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Up:
                Bot2.DURATION += 1;
                break;

            case Keys.Down:
                Bot2.DURATION -= 1;
                if (Bot2.DURATION < 1)
                {
                    Bot2.DURATION = 1;
                }
                break;

            case Keys.PageUp:
                Bot2.TURN_DURATION += 0.5f;
                break;

            case Keys.PageDown:
                Bot2.TURN_DURATION -= 0.5f;
                if (Bot2.TURN_DURATION < 0.5)
                {
                    Bot2.TURN_DURATION = 0.5f;
                }
                break;

            case Keys.F:
                Bot2.SendVehicleCommand("forward");
                break;

            case Keys.B:
                Bot2.SendVehicleCommand("backward");
                break;

            case Keys.L:
                Bot2.SendVehicleCommand("left");
                break;

            case Keys.R:
                Bot2.SendVehicleCommand("right");
                break;
            }
            this.Text = "Duration = " + Bot2.DURATION.ToString() + ", Turn Duration = " + Bot2.TURN_DURATION.ToString();
        }
Example #4
0
 // I could have done this a number of ways, or even in form load.
 // I just chose to kick off the twitch connection via a double click on the form
 private void FrmMain_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     twitchBot = new Bot2(OnTimeUpdate, OnLeftUpdate, OnRightUpdate, OnForewardUpdate, OnBackUpdate, OnListUpdate);
 }