/// <summary> /// Add the transform of card to hand. /// Adjust the position of all hand cards. /// </summary> /// <param name="go"></param> public override void Add(UICard card) { Assert.IsTrue(Hands.Count < MAXSIZE); //UICard card = go.GetComponent<UICard>(); GameObject go = card.gameObject; Hands.Add(card); int firstInd = GetFirstCardIndex(); if (count % 2 == 1) { MultiAnimation moves = new MultiAnimation(); for (int i = 0; i < count; ++i) { Transform targetPos = CardPos[firstInd + i]; LSAnimation move = AnimationFactory.Instance.CreatMove(Hands[i].gameObject, targetPos); go.transform.SetParent(transform); moves.Add(move); } AnimationManager.Instance.AddAnimation(moves); } Transform targetPos2 = CardPos[firstInd + count - 1]; LSAnimation move2 = AnimationFactory.Instance.CreatMove(go, targetPos2); go.transform.SetParent(transform); AnimationManager.Instance.AddAnimation(move2); }
public Command sendCommand(string id, Hands hand, Action action, Vector3 position) { Command command = new Command(id, hand, action, position); manageCommand(command); return(command); }
public bool NextInteract(Hands hands) { StopAllCoroutines(); //Debug.Log("Zooming to head"); StartCoroutine(ZoomTo(hands.head, hands.transform.parent.gameObject, false)); return true; }
private Result GetShootResult(Hands given, Hands gotten) { if (given == Hands.Empty) { return(Result.Lost); } var givenValue = (int)given % 3; var gottenValue = (int)gotten % 3; if (givenValue > gottenValue) { return(Result.Won); } if (givenValue < gottenValue) { return(Result.Lost); } if (givenValue == gottenValue) { return(Result.Tie); } return(Result.Lost); }
public override void Interact(Hands hands) { StopAllCoroutines(); //Debug.Log("Zooming to panel"); StartCoroutine(ZoomTo(camTarget, hands.transform.parent.gameObject, true)); hands.next = NextInteract; }
void Awake() { up = KeyCode.W; down = KeyCode.S; left = KeyCode.A; right = KeyCode.D; jump = KeyCode.Space; interact = KeyCode.F; //book = KeyCode.Tab; run = KeyCode.LeftShift; crouch = KeyCode.C; rb = GetComponent <Rigidbody> (); fpscam = transform.FindChild("Camera"); canjump = true; hands = GetComponent <Hands> (); hands.ctrl = this; //uwater = fpscam.GetComponent<Underwater> (); questbook = GameObject.Find("questbook"); if (questbook) { questbook.SetActive(false); } inbook = false; camobj = fpscam.GetComponent <FPSCam> (); loadout = transform.FindChild("loadout"); //equip fists rfist = loadout.FindChild("fist").gameObject; lfist = loadout.FindChild("fistalt").gameObject; hands.equip(true, rfist.transform); hands.equip(false, lfist.transform); defspd = spd; capsule = transform.FindChild("Capsule"); }
private void Start() { if (this.hands == null) { this.hands = FindObjectOfType <Hands>(); } }
public override Handler DoOpen(ParsedInput input) { if (input.Words.Length == 1) { return(Handler.HANDLED(MESSAGE_ENUM.ERROR_WHAT, "Open".ToParagraph())); } if (IsDead) { return(Handler.HANDLED(MESSAGE_ENUM.ERROR_PLAYER_IS_DEAD)); } ItemContainer container = ContainerSlots.GetContainer(input.Words[1]); if (container == null) { container = Hands.GetItem(input.Words[1], false, ITEM_TYPE.CONTAINER_ANY) as ItemContainer; } if (container == null) { container = CurrentRoom.Items.Find(input.Words[1], ITEM_TYPE.CONTAINER_ANY) as ItemContainer; } if (container == null) { return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_ITEM)); } if (!container.Closed) { return(Handler.HANDLED(MESSAGE_ENUM.ERROR_CONTAINER_ALREADY_OPEN, container.NameAsParagraph)); } container.Closed = false; return(Handler.HANDLED(MESSAGE_ENUM.PLAYER_OPEN, container.NameAsParagraph)); }
public TWItemScript[] haveTheItems(TWItemScript[] items) { Hands manos = this.GetComponent <Hands>(); Cell pos = (Cell)this.Entity.Position; List <Cell> vecinas = new List <Cell>(pos.Map.getNeightbours(pos)); vecinas.Add(pos); bool have = true; foreach (TWItemScript it in items) { if (manos.leftHand != it && manos.rightHand != it) { if (it.Entity.Position is Cell) { if (!vecinas.Contains((Cell)it.Entity.Position)) { have = false; } } else { have = false; } } } return(have?items:null); }
public override void Interactive(Hands hnd) { if (!itemControler.GetSlot(0).IsEmpty()) { StartCoroutine(GrillCoroutine()); } }
private void IsStraight(List <Card> cards, bool hasStraight) { if (hasStraight) { //RemoveCardsFromStraight(cards); if (cards.Count == 7) { for (int i = 0; i < cards.Count; i++) { cards.RemoveAt(i); if (i == 1) { break; } } BestCards.AddRange(cards); } Suit = cards[2].Suit; HandValue = Hands.Straight; //return; } return; }
public override void Interactive(Hands hnd) { if (!itemControler.GetSlot(2).IsEmpty()) { if (gManager.IsCraftRRecipeExists(itemControler.GetSlot(0).ItemID, itemControler.GetSlot(1).ItemID, itemControler.GetSlot(2).ItemID)) { int targetItem = gManager.CraftRecipe(itemControler.GetSlot(0).ItemID, itemControler.GetSlot(1).ItemID, itemControler.GetSlot(2).ItemID); itemControler.GetSlot(3).SetItem(targetItem); for (int i = 0; i < 3; i++) { itemControler.GetSlot(i).DestroyItem(); } } else { itemControler.GetSlot(3).SetItem(12); for (int i = 0; i < 3; i++) { itemControler.GetSlot(i).DestroyItem(); } } } }
/// <summary> /// 确定这些牌都来自玩家的手牌或者装备中 /// </summary> /// <param name="aCards">需要检查的牌</param> /// <returns>若都在手牌或者装备中,返回true</returns> public bool HasCardsInHandOrEquipage(Card[] aCards) { foreach (Card c in aCards) { if (c != null) { if (!Hands.Contains(c)) { if (c != Weapon) { if (c != Armor) { if (c != Jia1Ma) { if (c != Jian1Ma) { return(false); } } } } } } } return(true); }
public void NewHand() { _dealerButtonPosition = ++_dealerButtonPosition % Settings.NumberOfPlayers; // Separate function? Hands.Add(new Hand(Players, _dealerButtonPosition)); PayBlinds(); _handInProgress = true; }
//Check pinch and grab pose public bool IsPinching(Leap.Hand hand) { if (Hands.GetIndex(hand).IsExtended) { return(false); } //return hand.PinchStrength > .9f; //first and foremost we need the index to be pinched, if it it is we have a true bool pinch = checkPinchOfFinger(hand, "index"); //if we are in pinch with index check to see if other fingers are not. if (pinch) { string[] fings = { "ring", "pinky" }; foreach (string f in fings) { //If any other finger is in pinch return false if (checkPinchOfFinger(hand, f)) { return(false); } } } return(pinch); }
private void Update() { if (!isLocalPlayer) { return; } if (Input.GetButtonDown("SwapActive")) { activeHand = activeHand == Hands.Left ? Hands.Right : Hands.Left; inventoryUI.SwitchActiveHand(activeHand); } if (Input.GetButtonDown("DropActive")) { RemoveItem(GetActiveHandSlot()); } if (Input.GetButtonDown("Click")) { RaycastHit hit; Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit, 100)) { Item item = hit.collider.GetComponent <Item>(); if (item != null) { AddItem(item); } } } }
public void RockWinChecker_IfUIIsRockItWillGoToThisFunc_True() { User1 firstUser = new User1("nikhil", "R"); User2 secondUser = new User2("Nik", "P"); Assert.AreEqual(Hands.RockWinChecker(firstUser, secondUser), 0); }
public Hand(Hands actHand, Transform hand, Transform shoulder) { this.actHand = actHand; this.hand = hand; focus = shoulder.Find("ObjectGrabCenter/HandFocus"); focusDesiredPosition = focus.position; restPosition = shoulder.Find("HandGrabPosition"); refPosGrabObj = hand.Find("RefPosToGrab"); spdFocus = 30f; ik = false; objInHand = null; command = null; //Flags indicando a necessidade de executar ResetCrouch e ResetSpine resetHand = false; switch (actHand) { case Hands.Left: animatorParam = "LeftHandReach"; break; default: animatorParam = "RightHandReach"; break; } }
void Update() { Hands hands = new Hands(); if (Input.GetKeyDown(KeyCode.Mouse0)) { hands |= Hands.Left; } if (Input.GetKeyDown(KeyCode.Mouse1)) { hands |= Hands.Right; } HandsStatus = hands; if (TableitemControler != null) { if ((hands & Hands.Left) == Hands.Left) { LeftHand.GrabOrPlaceItem(TableitemControler.GetMainSlot()); } if ((hands & Hands.Right) == Hands.Right) { RightHand.GrabOrPlaceItem(TableitemControler.GetMainSlot()); } } }
public void SafetyLock(Hands hand, ButtonLock changeLock, bool flag) { ControllerInput input = hand == Hands.Right ? RC : LC; switch (changeLock) { case ButtonLock.HandTrigger: input.HandTrigger.IsLock = flag; break; case ButtonLock.IndexTrigger: input.IndexTrigger.IsLock = flag; break; case ButtonLock.Button1: input.Button1.IsLock = flag; break; case ButtonLock.Button2: input.Button2.IsLock = flag; break; case ButtonLock.Stick: input.StickIsLock = flag; break; case ButtonLock.All: input.HandTrigger.IsLock = flag; input.IndexTrigger.IsLock = flag; input.StickIsLock = flag; input.Button1.IsLock = flag; input.Button2.IsLock = flag; break; } }
/* * Todo: Check card hands * Todo: animate cards * Todo: find better background for main screen * Todo: Style end menu */ /// <summary> /// Add card to specified hand /// </summary> /// <param name="hand"></param> private void AddCardToHand(Hands hand) { var random = _rand.Next(0, _cards.Count); switch (hand) { case Hands.Bank: _banksHand.Add(_cards[random]); BankHand.Children.Add(new Image { Source = new BitmapImage(_cards[random].FileLocation), Effect = new DropShadowEffect() }); break; case Hands.Player: _playersHand.Add(_cards[random]); PlayerHand.Children.Add(new Image { Source = new BitmapImage(_cards[random].FileLocation), Effect = new DropShadowEffect() }); break; default: throw new ArgumentOutOfRangeException(nameof(hand), hand, null); } CheckHand(); PointsLabel.Content = $"Points: {_playersHand.Sum(x => x.Value)}"; _cards.RemoveAt(random); }
void Update() { if (_handController == null || !_handController.GetLeapController().IsConnected) { return; } var h = (Type == HandType.Left) ? Hands.Left : Hands.Right; if (h == null) { return; } if (h.Confidence < 0.7f) { return; } Direction.Invoke(h.Direction.ToQuaternion()); Position.Invoke(h.PalmPosition.ToVector3()); Fist.Invoke(Hands.GetFistStrength(h)); foreach (var f in h.Fingers) { _fingers [(int)f.Type].Invoke(f); } }
public HandsTest() { int playerScore = 5; int dealerScore = 20; sut = new Hands(playerHand, playerScore, dealerHand, dealerScore); }
public Manager(frmMain mainForm) { m_mainForm = mainForm; m_eyes = new Eyes(this); m_hands = new Hands(); m_ears = new Ears(this); m_mouth = new Mouth(m_mainForm); m_legs = new Legs(); m_actualState = FishingState.Stopped; m_neededActions = NeededAction.None; m_fishingStats.Reset(); //InitializeTimer(Timer, Handler); InitializeTimer(ref m_nextActionTimer, TakeNextAction); InitializeTimer(ref m_LureTimer, LureTimerTick); InitializeTimer(ref m_CharmTimer, CharmTimerTick); InitializeTimer(ref m_RaftTimer, RaftTimerTick); InitializeTimer(ref m_BaitTimer, BaitTimerTick); InitializeTimer(ref m_HearthStoneTimer, HearthStoneTimerTick); InitializeTimer(ref m_AntiAfkTimer, AntiAfkTimerTick); ResetTimers(); }
//This is called for player 2's buttons public void Player2Choices() { //Check to see if you're against the computer //If you are, computer picks randomly //Otherwise the second player makes a decision if (isAgainstComputer) { //playerTwoHand = (Hands)Random.Range(0, 3); playerTwoHand = (Hands)CallRandom(); } else { if (EventSystem.current.currentSelectedGameObject.name == "P1_Rock") { playerTwoHand = Hands.Rock; } else if (EventSystem.current.currentSelectedGameObject.name == "P2_Paper") { playerTwoHand = Hands.Paper; } else if (EventSystem.current.currentSelectedGameObject.name == "P2_Scissors") { playerTwoHand = Hands.Scissors; } } playerTwoHandController.SetTrigger(playerTwoHand.ToString()); DisableButtons(2); //After either choice, update the turn counter turnCounter++; }
private void Take(InteractionEvent interactionEvent, InteractionReference arg2) { Hands hands = (Hands)interactionEvent.Source.GetRootSource(); hands.GameObject.GetComponent <Inventory>() .MoveItem(((IGameObjectProvider)interactionEvent.Target).GameObject, 0, hands.ContainerObject, hands.HeldSlot); }
public void SubmitCards(string playerId, IEnumerable <Guid> cardIds) { var cards = cardIds.ToList(); CurrentRound.SubmitCards(playerId, cards); cards.ForEach(k => Hands.Get(playerId).CardsInHand.Remove(k)); }
public Interactable Take(Hands hands) { if (hands.heldItem) { return(null); // cant take in occupied hands } if (inSlot) { OnRemovedFromSlot(inSlot); inSlot.OnItemRemoved(); inSlot.itemInSlot = null; } inSlot = null; transform.SetParent(hands.transform); transform.localPosition = hands.holdOffset; isHeld = true; inHands = hands; if (pickupClip) { pickupClip.Play2D(soundVolume); } Debug.Log($"Took {name}"); return(this); }
protected virtual void Awake() { _controller = GetComponent <CharacterController2D>(); _input = GetComponent <PlayerInput>(); _hands = GetComponentInChildren <Hands>(); FacingDirection = 1; }
public Command sendCommand(string id, Hands hand, Action action, Transform transform) { Command command = new Command(id, hand, action, transform); manageCommand(command); return(command); }
public Manager(IManagerEventHandler managerEventHandler, IProgress <string> progressHandle) { m_managerEventHandler = managerEventHandler; m_eyes = new Eyes(); m_hands = new Hands(); m_ears = new Ears(); m_mouth = new Mouth(progressHandle); m_legs = new Legs(); m_fishingState = FishingState.Stopped; m_neededActions = NeededAction.None; m_fishingStats = new FishingStats(); m_fishingStats.Reset(); _cancellationTokenSource = null; InitializeTimer(ref m_LureTimer, LureTimerTick); InitializeTimer(ref m_CharmTimer, CharmTimerTick); InitializeTimer(ref m_RaftTimer, RaftTimerTick); InitializeTimer(ref m_BaitTimer, BaitTimerTick); InitializeTimer(ref m_HearthStoneTimer, HearthStoneTimerTick); InitializeTimer(ref m_AntiAfkTimer, AntiAfkTimerTick); ResetTimers(); }
private void CheckForPlayerEndOfTurn() { if (Hands.All(h => h.Status != HandStatusTypes.InProgress)) { Status = PlayerStatusTypes.Complete; } }
public Weapon(string weaponName, string weaponType, int price, float weight, Hands hands, int attackValue, int attackModifier, DamageEffectData damageEffectData, params string[] allowableClasses) : base(weaponName, weaponType, price, weight, allowableClasses) { NumberHands = hands; AttackValue = attackValue; AttackModifier = attackModifier; DamageEffect = damageEffectData; }
public IHands DealCards(Deck deck, int numberOfPlayers) { var hands = new Hands(); int count = deck.Cards.Count; for (int i = 0; i < count; i = i+numberOfPlayers) { hands.HandOne.Add(deck.Cards.Pop()); hands.HandTwo.Add(deck.Cards.Pop()); } return hands; }
public void BePickedByPlayers() { var players = new TwoPlayers(); var hands = new Hands(); hands.HandOne.Add(Jack.Of(CardSuit.Spades)); hands.HandTwo.Add(King.Of(CardSuit.Hearts)); hands.To(players.PlayerOne, players.PlayerTwo); Assert.AreEqual(1, players.PlayerOne.Hand().Count); Assert.AreEqual(1, players.PlayerTwo.Hand().Count); }
public override void Interact(Hands hands) { hands.held = this; // Debug.Log("Picking up "+name); transform.parent = hands.transform; rigidbody.useGravity = false; hands.joint.connectedBody = rigidbody; hands.joint.SetTargetRotationLocal(Quaternion.identity, transform.localRotation); IgnoreCollision(hands.transform.parent.gameObject, true); hands.next = NextInteract; }
public Weapon( string weaponName, string weaponType, int price, float weight, Hands hands, int attackValue, int attackModifier, int damageValue, int damageModifier, params Type[] allowableClasses) : base(weaponName, weaponType, price, weight, allowableClasses) { NumberHands = hands; AttackValue = attackValue; AttackModifier = attackModifier; DamageValue = damageValue; DamageModifier = damageModifier; }
public Weapon( string name, string type, int price = 0, float weight = 0.0f, Hands hands = Hands.One, int attackValue = 0, int attackModifier = 0, int damageValue = 0, int damageModifier = 0, params string[] allowedClasses) : base(name, type, price, weight, allowedClasses) { Hands = hands; AttackValue = attackValue; AttackModifier = attackModifier; DamageValue = damageValue; DamageModifier = damageModifier; }
public bool NextInteract(Hands hands) { hands.held = null; // Debug.Log("Dropping "+name); transform.parent = null; rigidbody.useGravity = true; hands.joint.connectedBody = null; //rigidbody.AddForce(hands.transform.parent.GetComponent<CharacterController>().velocity + rigidbody.velocity + hands.transform.forward*.2f, ForceMode.VelocityChange); if (hands.interactor != null) { Socket socket = hands.interactor.GetComponent<Socket>(); if (socket != null && socket.CanConnectItem(this)) { socket.ConnectItem(this); } IgnoreCollision(hands.transform.parent.gameObject, false); } else { IgnoreCollision(hands.transform.parent.gameObject, false); } return true; }
public void DisconnectItem(Hands hands) { if (isLocked) return; connectedItem.Interact(hands); connectedItem.rigidbody.isKinematic = false; connectedItem = null; OnDisconnected(); }
public void MakeDecision(int amoutOfPlayers) { int wait = random.Next(500, 5000); System.Threading.Thread.Sleep(wait); double current = 0; double futureChance = 0; CheckWinningHand(amoutOfPlayers); double[] chances = CalculateChances(amoutOfPlayers); //int allChecker = random.Next(1, 250); // op basis van deze zaken/kansen raisen/checken/folden // inzetten op basis van de huidige winning hand if (previousHand != CurrentHand) { previousHand = CurrentHand; current = Money; switch (CurrentHand) { case Hands.HighestCard: { current *= ((random.NextDouble()*(0.02 - 0.01)) + 0.01); break; } case Hands.Pair: { current *= ((random.NextDouble() * (0.06 - 0.025)) + 0.025); break; } case Hands.TwoPair: { current *= ((random.NextDouble() * (0.18 - 0.06)) + 0.03); break; } case Hands.ThreeOfAKind: { current *= ((random.NextDouble() * (0.2 - 0.09)) + 0.09); break; } case Hands.Straight: { current *= ((random.NextDouble() * (0.35 - 0.05)) + 0.05); break; } case Hands.Flush: { current *= ((random.NextDouble() * (0.4 - 0.05)) + 0.05); break; } case Hands.FullHouse: { current *= ((random.NextDouble() * (0.5 - 0.05)) + 0.05); break; } case Hands.FourOfAKind: { current *= ((random.NextDouble() * (0.6 - 0.05)) + 0.05); break; } case Hands.StraightFlush: { current *= 1; break; } } } //inzetten op basis van de kansen double df = Money * ((random.NextDouble() * (0.02 - 0.01)) + 0.01); //Pair futureChance = chances[0] > 20 ? Money*((random.NextDouble()*(0.02 - 0.01)) + 0.01) : futureChance; //Two Pair futureChance = chances[1] > 14 ? Money* ((random.NextDouble()*(0.035 - 0.02)) + 0.02) : futureChance; //Three-of-a-kind futureChance = chances[2] > 8 ? Money * ((random.NextDouble() * (0.045 - 0.03)) + 0.03) : futureChance; //Straigth futureChance = chances[5] > 12 ? Money * ((random.NextDouble() * (0.1 - 0.05)) + 0.05) : futureChance; futureChance = chances[5] > 17 ? Money * ((random.NextDouble() * (0.14 - 0.07)) + 0.07) : futureChance; //Flush futureChance = chances[3] > 20 ? Money * ((random.NextDouble() * (0.085 - 0.04)) + 0.04) : futureChance; //Full house futureChance = chances[4] > 10 ? Money * ((random.NextDouble() * (0.12 - 0.05)) + 0.05) : futureChance; //Four-of-a-kind futureChance = chances[6] > 4 ? Money * ((random.NextDouble() * (0.13 - 0.05)) + 0.05) : futureChance; //Straight flush futureChance = chances[7] > 4 ? Money * ((random.NextDouble() * (0.1 - 0.05)) + 0.05) : futureChance; int bet = (int)(current + futureChance); // Wanneer de bot raised met 2 of 3, hem laten checken. Anders blijft er steeds met beetjes hoger gebet. if (bet <= Table.CurrentBet-CurrentBet * 1.2 && bet >= Table.CurrentBet-CurrentBet) { bet = Table.CurrentBet-CurrentBet; } // Wanneer we dezelfde ronde 2 keer spelen, omdat de bets verschillen, de bot niet opnieuw een hoger bet laten maken // Anders kunnen we bezig blijven. if (CurrentBet != 0) { bet = 0; } highestBet = bet > highestBet ? bet : highestBet; //indien er nog geen kaarten zijn omgedraaid. if (Table.Pokercards.Where(c => c.FaceUp).ToList().Count == 0) { // Als het bedrag dat gebet werd in de eerste ronde < 15% van het huidige budget // ander wordt er gefold if ((Table.CurrentBet <= ((random.NextDouble() * (100 - 50)) + 50)) && (allChecker < 60 || allChecker > 70)) { Check(); } //als de allchecker tussen 60 en 70 ligt zal er een bet geplaatst worden //(1 speler die bluft en voortdurend volgt = allchecker) //Initieel zal hij een bet plaatsen else if ((allChecker >= 60 && allChecker <= 70)) { if (Table.CurrentBet >= Money) { Bet(Money); } else { Bet(random.Next(Table.CurrentBet, (int)(Money*0.05))); } } else { Fold(); } } //Indien er al kaarten zijn omgedraaid else { if (Table.CurrentBet -CurrentBet > (bet*1.5) && (Money * ((random.NextDouble()*(0.15-0.01))+0.01)) <= Table.CurrentBet-CurrentBet && Table.CurrentBet-CurrentBet > (highestBet * 1.2) ) { Fold(); } else { if (bet >= Money && Table.CurrentBet-CurrentBet < bet && (allChecker > 60 && allChecker < 70)) { Bet(Money); } //Als het huidige bet minder dan 5% van het huidige budget bevat wordt er ook gechecked else if ((bet <= (Table.CurrentBet-CurrentBet) || (allChecker > 60 && allChecker < 70))) { Check(); } else { Bet(bet); } } } }
public bool[] checkWinningHand() { bool[] winningHands = new bool[9]; currentHand = Hands.HighestCard; bool pair = false, twoPair = false, threeOfAKind = false, straight = false, flush = false; WinningCards = GetHighestCard(); pair = IsPair(); if (pair) { winningHands[1] = true; currentHand = Hands.Pair; WinningCards = GetPair(); twoPair = IsTwoPair(); if (twoPair) { winningHands[2] = true; currentHand = Hands.TwoPair; WinningCards = GetTwoPair(); } } if (pair) { threeOfAKind = IsThreeOfAKind(); if (threeOfAKind) { winningHands[3] = true; currentHand = Hands.ThreeOfAKind; WinningCards = GetThreeOfAKind(); } } straight = IsStraight(); if (straight) { winningHands[4] = true; currentHand = Hands.Straight; WinningCards = GetStraight(); } flush = IsFlush(); if (flush) { winningHands[5] = true; currentHand = Hands.Flush; WinningCards = GetFlush(); } if (pair & threeOfAKind) { if (IsFullHouse()) { winningHands[6] = true; currentHand = Hands.FullHouse; WinningCards = GetFullHouse(); } } if (threeOfAKind) { if (IsFourOfAKind()) { winningHands[7] = true; currentHand = Hands.FourOfAKind; WinningCards = GetThreeOfAKind(); } } if (flush && straight) { if (IsStraightFulsh()) { winningHands[8] = true; currentHand = Hands.StraightFlush; WinningCards = GetStraightFlush(); } } return winningHands; }
public abstract void Interact(Hands hands);
/// <summary> /// The main method for handling motion. Checks for clapping or hover events. /// </summary> /// <param name="movingHand">The hand that is currently moving</param> /// <param name="x">The moving hand's current x position</param> /// <param name="y">The moving hand's current y position</param> public static void OnButtonLocationChanged(Hands movingHand, int x, int y) { HoverButton hand;//, otherHand; if (movingHand == Hands.Right) { hand = kinectRight; //otherHand = kinectLeft; } else if (movingHand == Hands.Left) { hand = kinectLeft; //otherHand = kinectRight; } else if (movingHand == Hands.Right1) { hand = kinectRight1; } else { hand = kinectLeft1; } #if (CLAPPING && !HOVER) if (!inAction && IsHandsTogetherOnAButton(hand, otherHand, buttons)) { // call the click event of the selected button _selectedButton.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent, _selectedButton)); } else { hand.Release(); inAction = false; } #endif //#if (HOVER && !CLAPPING) //if (!inAction && IsCursorOverObject(hand, buttons)) { hand.Hovering(); } //else { hand.Release(); inAction = false; } //#endif #if (CLAPPING && HOVER) //if (!inAction && IsHandsTogetherOnAButton(hand, otherHand, buttons)) //{ // // call the click event of the selected button // _selectedButton.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent, _selectedButton)); //} //else if (!inAction && IsCursorOverObject(hand, buttons)) { hand.Hovering(); } //else { hand.Release(); inAction = false; } #endif //Canvas.SetLeft(hand, x - (hand.ActualWidth / 2)); //hand.Dispatcher.Invoke(new Action(delegate() { hand. object[] param1 = {hand, x - (hand.ActualWidth / 2)}; hand.Dispatcher.Invoke( new Action<HoverButton, double>( delegate(HoverButton h, double p) { Canvas.SetLeft(h, p); }), param1 ); //Canvas.SetTop(hand, y - (hand.ActualHeight / 2)); object[] param2 = { hand, y - (hand.ActualHeight / 2) }; hand.Dispatcher.Invoke( new Action<HoverButton, double>( delegate(HoverButton h, double p) { Canvas.SetTop(h, p); }), param2 ); }
public override void Interact(Hands hands) { if (!isLocked && connectedItem) { connectedItem.Interact(hands); DisconnectItem(hands); } }