本文整理汇总了C#中Hand类的典型用法代码示例。如果您正苦于以下问题:C# Hand类的具体用法?C# Hand怎么用?C# Hand使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Hand类属于命名空间,在下文中一共展示了Hand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AceExorcistGame
public AceExorcistGame()
{
//Create Deck and Hand for Exorcist, and draw 5 cards from Deck to Hand
ExorcistLibrary = new Deck(IsExorcist);
ExorcistHand = new Hand();
for (int i = 1; i < 6; i++)
{
ExorcistHand.addCard( ExorcistLibrary.TakeCard() );
}
//Create Deck and Hand for Exorcist, and draw 5 cards from Deck to Hand
IsExorcist = false;
SummonerLibrary = new Deck(IsExorcist);
for (int i = 1; i < 6; i++)
{
SummonerHand.addCard(SummonerLibrary.TakeCard());
}
//Create Summon Zone
SummonZone = new Hand();
//Create Discards (as a Hand - but not in this implementation)
}
示例2: TestInitialGesture
//Test the initial posture of the hand to start the gesture
protected override void TestInitialGesture(Hand hand)
{
InitialPosition = hand.PalmPosition.x;
PreviousHand = hand;
ListeGesture[0].TestGesture(hand);
//ReceiveBeginningRightMoveEvent();
}
示例3: HandleMovement
void HandleMovement(Hand currentFrameHand)
{
horizontalMove = 0;
verticalMove = 0;
horizontalLook = 0;
if(currentFrameHand.IsValid)
{
horizontalMove = hMoveScale * currentFrameHand.PalmNormal.Roll / Mathf.PI ;
verticalMove = vMoveScale * currentFrameHand.Direction.Pitch / Mathf.PI;
horizontalLook = hLookScale * currentFrameHand.Direction.Yaw / Mathf.PI;
// debug visualization
//Debug.DrawLine(transform.position, transform.position + new Vector3(currentFrameHand.PalmNormal.Roll , 0, 0) * 2.150f, Color.green, 0, false);
//Debug.DrawLine(transform.position, transform.position + new Vector3(0 , currentFrameHand.Direction.Pitch, 0) * 2.150f, Color.blue, 0, false);
//Debug.DrawLine(transform.position, transform.position + new Vector3(0 , 0, currentFrameHand.Direction.Yaw) * 2.150f, Color.red, 0, false);
}
if(Mathf.Abs(horizontalMove) < 5)
{
acrobaticsScript.RotateToInitialRotation();
}
else
{
playerScript.HandleControls(-horizontalMove, -verticalMove);
}
//Debug.Log(horizontalMove);
}
示例4: Update
// Update is called once per frame
void Update()
{
frame = lp.CurrentFrame;
if (frame.Hands.Count > 0) {
if (frame.Hands.Leftmost.IsLeft) {
righty = frame.Hands.Leftmost;
rfingers = right.fingers;
}
}
if (right.isActiveAndEnabled) {
if (Vector3.Distance (right.GetPalmPosition (), rfingers [0].GetTipPosition ()) > trigger &&
Vector3.Distance (right.GetPalmPosition (), rfingers [1].GetTipPosition ()) > trigger &&
Vector3.Distance (right.GetPalmPosition (), rfingers [2].GetTipPosition ()) < trigger &&
Vector3.Distance (right.GetPalmPosition (), rfingers [3].GetTipPosition ()) < trigger &&
Vector3.Distance (right.GetPalmPosition (), rfingers [4].GetTipPosition ()) < trigger ) {
Debug.Log ("rockgod!!");
rockgod = true;
} else {
rockgod = false;
}
if (rockgod) {
line.enabled = true;
Ray ray = new Ray (rfingers [1].GetTipPosition (), rfingers[1].GetBoneDirection(2));
// Ray ray1 = new Ray (rfingers [4].GetTipPosition (), rfingers [4].GetBoneDirection ());
line.SetPosition (0, ray.origin);
line.SetPosition (1, ray.GetPoint (100));
} else {
line.enabled = false;
}
}
}
示例5: SetLeapHand
public void SetLeapHand(Hand hand) {
hand_ = hand;
for (int i = 0; i < fingers.Length; ++i) {
if (fingers[i] != null)
fingers[i].SetLeapHand(hand_);
}
}
示例6: ToString_StringEmptyHand
[TestMethod] // ♣
public void ToString_StringEmptyHand() // ♦
{ // ♥
IHand hand = new Hand(new List<ICard>()); // ♠
string actual = hand.ToString();
Assert.AreEqual(String.Empty, actual, "Tostring() method of Hand not implemented currenctly.");
}
示例7: twoHandsWithDifferentCardsShouldNotBeEqual
public void twoHandsWithDifferentCardsShouldNotBeEqual()
{
var Hand = new Hand(asCardArray("J-H", "A-S", "5-C", "7-D", "3-C"));
var OtherHand = new Hand(asCardArray("A-C", "K-D", "4-D", "3-S", "6-H"));
Assert.IsFalse(Hand.Equals(OtherHand));
}
示例8: MakePlay
public Card MakePlay(Card Down, Hand Hand)
{
List<Card> V = new List<Card>();
foreach (Card Card in Hand)
{
if (_Function.Invoke(Down, Card)) V.Add(Card);
}
int M = Int32.MaxValue;
Card Choice = null;
foreach (Card Card in V)
{
int N = 0;
foreach (Card DownCard in _ImaginaryDeck)
{
if (_Function.Invoke(DownCard, Card)) N++;
}
if (N < M)
{
M = N;
Choice = Card;
}
}
return Choice;
}
示例9: EvaluateCards
public static int EvaluateCards(Hand hand)
{
int[] cards = new int[hand.Count];
for (int i = 0; i < hand.Count; i++)
cards[i] = hand.ElementAt(i).Number;
return EvaluateCards(cards);
}
示例10: Start
//public City CurrentCity;
//public int cityID;
public void Start()
{
//roleCard = new GameObject("roleCard").AddComponent<_roleCard>();
print("Start of Player");
hand = new GameObject("hand").AddComponent<Hand>();
}
示例11: checkGrabbed
void checkGrabbed(Hand hand)
{
if (hand.GrabStrength > OnGrabStrength)
Globals.SetSlowMotionTrue();
if (hand.GrabStrength <= OffGrabStrength)
Globals.SetSlowMotionFalse();
}
示例12: NormalizedCoords
public HandCoords NormalizedCoords(Hand h, float HorizontalAngle, float VerticalAngle)
{
HandCoords coords = AngleCoords(h);
coords.horizontal = (coords.horizontal - (90 - HorizontalAngle/2))/HorizontalAngle;
coords.vertical = (coords.vertical - (90 - VerticalAngle / 2)) / VerticalAngle;
return coords;
}
示例13: TestIsValidHand_WithNoCards
public void TestIsValidHand_WithNoCards()
{
Hand currentHand = new Hand(new List<ICard>());
PokerHandsChecker checker = new PokerHandsChecker();
bool isValidHand = checker.IsValidHand(currentHand);
Assert.AreEqual(false, isValidHand);
}
示例14: checkStabiliseGesture
private bool checkStabiliseGesture(Hand leftHand, Hand rightHand)
{
float leftHandHeight = leftHand.PalmPosition.y;
float rightHandHeight = rightHand.PalmPosition.y;
float averageHandHeight = (leftHandHeight + rightHandHeight) / 2;
if(!stabiliseTopHit){
if(averageHandHeight > 175){
stabiliseTopHit = true;
startTime = Time.time;
return false;
}
}else{
if(averageHandHeight <= 120){
float timeDiff = Time.time - startTime;
if(timeDiff < 0.9){
Debug.Log("Time Diff: " + timeDiff);
stabiliseTopHit = false;
return true;
}else{
stabiliseTopHit = false;
Debug.Log ("Out of Time");
}
}
}
return false;
}
示例15: Start
// Use this for initialization
void Start () {
//for now, has the same amount as a normal deck?
cardAmount = 30;
cardsRemaining=cardAmount;
maxHandValue = 6; //this is also specified in AceExorcistGames.cs???
//deck = new Deck(); - moved this into AceExorcistGames.cs
//create references to the player's Hand component and the enemy's
playerH = GameObject.Find("Player_Hand").GetComponent<Hand>();
enemyH = GameObject.Find("Enemy_Hand").GetComponent<Hand>();
//Tests to see if card deck really works
Debug.Log("Amount of cards: " + deck.Cards.Count);
//shuffles deck
deck.shuffleDeck();
//Shows each card for that deck
Debug.Log("Cards on this deck");
for(int i =0;i< deck.Cards.Count;i++)
{
Debug.Log(deck.Cards[i].cardValue + " of "+ deck.Cards[i].Suit);
}
}