当前位置: 首页>>代码示例>>C#>>正文


C# Hand类代码示例

本文整理汇总了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)

	}
开发者ID:vitzex,项目名称:AceExorcistGGJ,代码行数:25,代码来源:AceExorcistGame.cs

示例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();
 }
开发者ID:lutrampal,项目名称:ProjetVR,代码行数:8,代码来源:RightMove.cs

示例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);
    }
开发者ID:AjayTalati,项目名称:BCI_Experiments,代码行数:28,代码来源:LMC_PlayerControls.cs

示例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;
            }
        }
    }
开发者ID:VRWizards,项目名称:VR-Project,代码行数:34,代码来源:LeftGun.cs

示例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_);
   }
 }
开发者ID:VentorLee,项目名称:unity,代码行数:7,代码来源:HandModel.cs

示例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.");
        }
开发者ID:vaster,项目名称:Telerik.vasko,代码行数:8,代码来源:HandToStringTest.cs

示例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));
    }
开发者ID:danielmiladinov,项目名称:PokerSharp,代码行数:7,代码来源:HandTest.cs

示例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;
        }
开发者ID:lawrencewade,项目名称:cs440,代码行数:25,代码来源:CheckerAI.cs

示例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);
 }
开发者ID:cheng93,项目名称:TexasHoldem,代码行数:7,代码来源:TwoPlusTwo.cs

示例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>();
    }
开发者ID:nstovring,项目名称:Pandemic,代码行数:9,代码来源:tmpPlayer.cs

示例11: checkGrabbed

 void checkGrabbed(Hand hand)
 {
     if (hand.GrabStrength > OnGrabStrength)
         Globals.SetSlowMotionTrue();
     if (hand.GrabStrength <= OffGrabStrength)
         Globals.SetSlowMotionFalse();
 }
开发者ID:sathiyavrs,项目名称:MMM-Fingers-Xtreme,代码行数:7,代码来源:LeapController.cs

示例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;
 }
开发者ID:NabilNoaman,项目名称:unite-12,代码行数:7,代码来源:SkeletonController.cs

示例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);
 }
开发者ID:quela,项目名称:myprojects,代码行数:7,代码来源:TestIsValidHand.cs

示例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;
    }
开发者ID:jacksterooney,项目名称:Into-the-Rift,代码行数:27,代码来源:Stabiliser.cs

示例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);
		}
		
	}
开发者ID:vitzex,项目名称:AceExorcistGGJ,代码行数:27,代码来源:DeckScript.cs


注:本文中的Hand类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。