Пример #1
0
        private void btnGo10_Click(object sender, EventArgs e)
        {
            RobotMovement robot    = new RobotMovement(getCordnates(), 10);
            Point         location = robot.moveRobot();

            lblArrow.Location = location;
        }
Пример #2
0
        private void bntReset_Click(object sender, EventArgs e)
        {
            //reset location and direction
            lblArrow.Location = new Point(95, 100);
            RobotMovement robot = new RobotMovement("NORTH");

            lblArrow.Text = Convert.ToChar(233).ToString();
        }
Пример #3
0
        public Form1()
        {
            InitializeComponent();

            //Set iniital position
            updateCords(new Point(0, 0));
            RobotMovement robot = new RobotMovement(getCordnates(), "NORTH");

            lblArrow.Text = Convert.ToChar(233).ToString();

            //Declare event handler, update cords when cords change
            lblArrow.Move += new EventHandler(HandleChange);
        }
Пример #4
0
        private void btnWest_Click(object sender, EventArgs e)
        {
            RobotMovement robot = new RobotMovement("WEST");

            lblArrow.Text = Convert.ToChar(231).ToString();
        }
Пример #5
0
        private void btnSouth_Click(object sender, EventArgs e)
        {
            RobotMovement robot = new RobotMovement("SOUTH");

            lblArrow.Text = Convert.ToChar(234).ToString();
        }