• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Hand类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Hand的典型用法代码示例。如果您正苦于以下问题:C# Hand类的具体用法?C# Hand怎么用?C# Hand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Hand类属于命名空间,在下文中一共展示了Hand类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: SwitchGesture

 public void SwitchGesture(string nextGesture, Hand side)
 {
     switch (side)
     {
         case Hand.left:
             foreach (var gesture in sGestures_L)
             {
                 if (gesture == nextGesture)
                     animator.SetBool("l_" + gesture, true);
                 else
                     animator.SetBool("l_" + gesture, false);
                 actualGestureL = nextGesture;
             }
             break;
         case Hand.right:
             foreach (var gesture in sGestures_R)
             {
                 if (gesture == nextGesture)
                     animator.SetBool("r_" + gesture, true);
                 else
                     animator.SetBool("r_" + gesture, false);
                 actualGestureR = nextGesture;
             }
             break;
         default:
             break;
     }
 }
开发者ID:SmartSignCapture,项目名称:SmartSignCapture,代码行数:28,代码来源:GestureAnimationController.cs


示例17: WarViewModel

        public WarViewModel(HandResult result)
        {
            PlayerOneHand = result.PlayerOneHand;
            PlayerTwoHand = result.PlayerTwoHand;

            RecentResults = result;
        }
开发者ID:chandlerclaxton,项目名称:war-card-game,代码行数:7,代码来源:WarViewModel.cs


示例18: Update

	void Update() {
		Controller controller = new Controller();
		Frame frame = controller.Frame();
		HandList hands = frame.Hands;
		hand = hands[0];
		otherHand = hands[1];
	}
开发者ID:tex2e,项目名称:3J-class-project,代码行数:7,代码来源:LeapHands.cs


示例19: twoHandsThatAreNotEqualShouldHaveDifferentHashCodes

    public void twoHandsThatAreNotEqualShouldHaveDifferentHashCodes()
    {
        var Hand = new Hand(asCardArray("A-S", "K-H", "Q-D", "J-C", "10-S"));
        var OtherHand = new Hand(asCardArray("Q-D", "10-C", "K-H", "A-S", "J-C"));

        Assert.AreNotEqual(Hand.GetHashCode(), OtherHand.GetHashCode());
    }
开发者ID:danielmiladinov,项目名称:PokerSharp,代码行数:7,代码来源:HandTest.cs


示例20: UpdateTracker

    protected override void UpdateTracker()
    {
        previousPosition = Position;
        previousOrientation = Orientation;
        previousGrabbingStrength = currentGrabbingStrength;

        //get the rightmost hand in the frame
        if (handController.GetAllGraphicsHands().Length != 0)
        {
            handModel = handController.GetAllGraphicsHands()[0];
            handModel.transform.GetComponentInChildren<SkinnedMeshRenderer>().enabled = visibleHand;
            hand = handModel.GetLeapHand();
            currentGrabbingStrength = lowPassFilter(hand.GrabStrength, previousGrabbingStrength);

            Position = lowPassFilter(handModel.GetPalmPosition(), previousPosition);
            Orientation = lowPassFilter(handModel.GetPalmDirection(), previousOrientation);
        }

        //mask/display the graphical hand on key down
        if (Input.GetKeyDown(visibleHandKey))
        {
            var smr = handModel.transform.GetComponentInChildren<SkinnedMeshRenderer>();
            visibleHand = !visibleHand;
        }

        Translation = Position - previousPosition;
        Rotation = previousOrientation - Orientation;
    }
开发者ID:Shujin-IIE,项目名称:RVSI-InteractionsTechniques,代码行数:28,代码来源:Virtual3DTrackerLeap.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# HandBrake类代码示例发布时间:2022-05-24
下一篇:
C# Half类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap