public static Gesture getGesture(Fingers f){ if(isNeutral(f)) return Gesture.Neutral; if(isUse(f)) return Gesture.Use; if(isThrow(f)) return Gesture.Throw; if(isBullet(f)) return Gesture.Bullet; if(isCurse(f)) return Gesture.Curse; if(isShield(f)) return Gesture.Shield; return Gesture.None; }
private static bool isShield(Fingers f){ int[] t={1,1,1,0,0}; return f.checkFingers(t); }
private static bool isCurse(Fingers f){ int[] t={1,1,1,1,1}; // all fingers opened return f.checkFingers(t); }
private static bool isBullet(Fingers f){ int[] t={1,0,0,1,1}; return f.checkFingers(t); }
private static bool isThrow(Fingers f){ int[] t={0,0,1,1,0}; return f.checkFingers(t); }
private static bool isNeutral(Fingers f){ int[] t={0,0,0,0,0}; // all fingers hidden return f.checkFingers(t); }