示例#1
0
    private void  initStates()
    {
        takeState = Take.Start;
        activateState = Activate.Start;
        deactivateState = Deactivate.Start;
        releaseState = Release.Start;
        tasteState = Taste.Start;
        smellState = Smell.Start;

        /*openDoorState = OpenDoor.Start;
        closeDoorState = CloseDoor.Start;*/
        moveState = Move.Start;
        rotateState = Rotate.Start;
        turnState = Turn.Start;
        commandStatus = CommandStatus.Running;
        headFocusState = HeadFocus.Start;
        headResetState = HeadReset.Start;
        lookForState = LookFor.Start;

        speakState = Speak.Start;

        cancelState = Cancel.Start;
        getSensesState = GetSenses.Start;

        reset = true;           
    }
示例#2
0
 private void end()
 {
     switch (action)
     {
         case Action.Take:
             takeState = Take.End;
             break;
         case Action.Activate:
             activateState = Activate.End;
             break;
         case Action.Deactivate:
             deactivateState = Deactivate.End;
             break;
         case Action.Release:
             releaseState = Release.End;
             break;
         case Action.Taste:
             tasteState = Taste.End;
             break;
         case Action.Smell:
             smellState = Smell.End;
             break;
         case Action.Move:
             moveState = Move.End;
             break;                
         case Action.Rotate:
             rotateState = Rotate.End;
             break;
         case Action.Turn:
               turnState = Turn.End;
               break;
         case Action.HeadFocus:
             headFocusState = HeadFocus.End;
             break;
         case Action.HeadReset:
             headResetState = HeadReset.End;
             break;
         case Action.LookFor:
             lookForState = LookFor.End;
             break;
         case Action.Speak:
             speakState = Speak.End;
             break;
         case Action.Cancel:
             cancelState = Cancel.End;
             break;
         case Action.GetSenses:
             getSensesState = GetSenses.End;
             break;
         default:
             break; ;
     }   
 }
示例#3
0
 private void changeStatus(int value)
 {
     if (commandStatus != CommandStatus.Fail && commandStatus != CommandStatus.Success)
     {
         switch (action)
         {
             case Action.Take:
                 if (takeState != Take.End)
                     takeState+=value;
                 break;
             case Action.Activate:
                 if (activateState != Activate.End)
                     activateState += value;
                 break;
             case Action.Deactivate:
                 if (deactivateState != Deactivate.End)
                     deactivateState += value;
                 break;
             case Action.Release:
                 if (releaseState != Release.End)
                     releaseState += value;
                 break;
             case Action.Taste:
                 if (tasteState != Taste.End)
                     tasteState += value;
                 break;
             case Action.Smell:
                 if (smellState != Smell.End)
                     smellState += value;
                 break;
             case Action.Move:
                 if (moveState != Move.End)
                     moveState+=value;
                 break;
             case Action.Rotate:
                  if (rotateState != Rotate.End)
                     rotateState+=value;
                 break;
             case Action.Turn:
                 if (turnState != Turn.End)
                      turnState+=value;
                break;
             case Action.HeadFocus:
                 if (headFocusState != HeadFocus.End)
                     headFocusState+=value;
                 break;
             case Action.HeadReset:
                 if (headResetState != HeadReset.End)
                     headResetState+=value;
                 break;
             case Action.LookFor:
                 if (lookForState != LookFor.End)
                     lookForState += value;
                 break;
             case Action.Speak:
                 if (speakState != Speak.End)
                    speakState += value;
                 break;
             case Action.Cancel:
                 if (cancelState != Cancel.End)
                     cancelState += value;
                 break;
             case Action.GetSenses:
                 if (getSensesState != GetSenses.End)
                     getSensesState += value;
                 break;
             default:
                 break;
         }
         commandStatus = CommandStatus.Running;
     }
 }