public bool AcceptOrders(handGesture LH, handGesture RH) { // Tester la validité // Pas 2 x le couteau if (LH == handGesture.Stab & RH == handGesture.Stab) { Debug.Print("Pas deux fois le couteau"); return false; } // Intervention du cerveau state // FEAR if (this.brain.state == HeadBrain.BrainState.Fear) { if ((FearGestureCompatibilityTest(LH) & FearGestureCompatibilityTest(RH))) { Debug.Print("Mouvement pas permis quand FEAR"); return false; } } this.rightArm.proposeHandGesture(RH); this.leftArm.proposeHandGesture(LH); return true; }
private bool FearGestureCompatibilityTest(handGesture geste) { switch (geste) { case handGesture.None: break; case handGesture.Stab: break; case handGesture.W: break; case handGesture.P: break; default: return false; } return true; }