/// <param name="e">this object contains all information about the requested movement</param> public void RobotMovementRequestHandler(object sender, RobotMovementRequestEventArgs e) { switch (e.movementType) { case RobotMovement.CleanUp: // tábla leszedés break; case RobotMovement.PlacePiece: // bábu felhelyezés status = RobotStatus.Moving; OnPostMessageShowRequest("movement (" + e.ToString() + ") started..."); if (aktmozgas(e.destRow, e.destCol) == 1) // TODO: new thread / async? { status = RobotStatus.Ready; } else { status = RobotStatus.ServoError; } OnPostMessageShowRequest("movement stopped"); break; case RobotMovement.Cheer: // nyertes mozdulat break; case RobotMovement.Grieve: // vesztes mozdulat break; } }
private void RobotMovementRequestHandler(object sender, RobotMovementRequestEventArgs e) { // do something to start the movement status = RobotStatus.Moving; OnPostMessageShowRequest("movement (" + e.ToString() + ") started..."); // sleep (estimated moving time()) //status = RobotStatus.Ready; OnPostMessageShowRequest("movement stopped"); }