// Method to return prize public static int Winning(HAND hand) { switch (hand) { case HAND.JacksOrBetter: return(1); case HAND.TwoPair: return(2); case HAND.ThreeOfAKind: return(3); case HAND.Straight: return(4); case HAND.Flush: return(6); case HAND.FullHouse: return(9); case HAND.FourOfAKind: return(25); case HAND.StraightFlush: return(50); case HAND.RoyalFlush: return(800); default: return(0); } }
// Method to return hand public static string HandCombo(HAND hand) { switch (hand) { case HAND.JacksOrBetter: return("Jacks Or Better"); case HAND.TwoPair: return("Two Pair"); case HAND.ThreeOfAKind: return("Three Of A Kind"); case HAND.Straight: return("Straight"); case HAND.Flush: return("Flush"); case HAND.FullHouse: return("Full House"); case HAND.FourOfAKind: return("Four Of A Kind"); case HAND.StraightFlush: return("Straight Flush"); case HAND.RoyalFlush: return("Royal Flush"); default: return("All others"); } }
public IEnumerator ActivateAttack(float time, HAND hand) { if (hand == HAND.two_hand) { twoHandBow.GetComponent <BowKind>().ActivateAttack(true); } if (hand == HAND.left) { swordL.GetComponent <SwordKind>().ActivateAttack(true); } if (hand == HAND.right) { swordR.GetComponent <SwordKind>().ActivateAttack(true); } yield return(new WaitForSeconds(time / animationSpeed)); if (hand == HAND.two_hand) { twoHandBow.GetComponent <BowKind>().ActivateAttack(false); } if (hand == HAND.left) { swordL.GetComponent <SwordKind>().ActivateAttack(false); } if (hand == HAND.right) { swordR.GetComponent <SwordKind>().ActivateAttack(false); } }
/// <summary> /// VTM 로봇이 Wafer를 들고 있는지 /// </summary> /// <returns></returns> public bool IsInVTM(HAND arm) { if (robotVTM[(int)arm] == null) { return(false); } return(true); }
// Method to handle DRAW choice private void HandleDraw() { EvaluateHand evaluator = new EvaluateHand(deckArray); HAND hand = evaluator.HandEvaluator(); // gets value of hand displayed currentPlayer.AddCredit(DetermineWinner.Winning(hand)); // Adds credit to player's balance View.DisplayWinning(hand, deckArray); ResetLocalDeck(); View.DealCards(deckArray); }
private void DisplayCardRanking(Hand player2Hand, HAND comparisonHandRanking, CARD comparisonHiCardInRank, bool isCurrentRankBest) { string output = string.Format("{0} [{1,12}:{2,1}] {3,1}{4} [{5,12}:{6,1}] {7}", GetHand(), bestRankForHand, highestCardInRank.ToString()[1], highestCardInRank > comparisonHiCardInRank ? ">" : (highestCardInRank < comparisonHiCardInRank ? "<" : "="), player2Hand.GetHand(), comparisonHandRanking, comparisonHiCardInRank.ToString()[1], isCurrentRankBest ? "WIN" : "" ); Console.WriteLine(output); }
// Method to display old hand and winning on the console public static void DisplayWinning(HAND hand, Card[] oldDeck) { Console.Clear(); Console.WriteLine("Your hand was: "); for (int i = 0; i < oldDeck.Length; i++) { Console.Write("{0, -20}", oldDeck[i]); } Console.WriteLine(); Console.WriteLine("Result: " + DetermineWinner.HandCombo(hand) + " and " + DetermineWinner.Winning(hand) + " was added to your credit."); }
/// <summary> /// CP에서 FM으로 이동 /// </summary> /// <param name="nSlot"></param> /// <returns></returns> public bool LoadingCpToFm(int nSlot, HAND arm) { if (CP[nSlot] == null || robotFM[(int)arm] != null) { return(false); } robotFM[(int)arm] = CP[nSlot]; CP[nSlot] = null; Save(); return(true); }
/// <summary> /// ATM에서 CP로 이동 /// </summary> /// <param name="nSlot">CP 슬롯 번호</param> /// <returns></returns> public bool LoadingAtmToCp(int nSlot, HAND arm) { if (robotATM[(int)arm] == null || CP[nSlot] != null) { return(false); } CP[nSlot] = robotATM[(int)arm]; robotATM[(int)arm] = null; Save(); return(true); }
/// <summary> /// HP에서 VTM으로 이동 /// </summary> /// <returns></returns> public bool LoadingHpToVtm(HAND arm) { if (hp == null || robotVTM[(int)arm] != null) { return(false); } robotVTM[(int)arm] = hp; hp = null; Save(); return(true); }
/// <summary> /// VTM에서 HP로 이동 /// </summary> /// <returns></returns> public bool LoadingVtmToHp(HAND arm) { if (robotVTM[(int)arm] == null || hp != null) { return(false); } hp = robotVTM[(int)arm]; robotVTM[(int)arm] = null; Save(); return(true); }
/// <summary> /// Aligner에서 ATM으로 이동 /// </summary> /// <returns></returns> public bool LoadingAlignerToAtm(HAND arm) { if (aligner == null || robotATM[(int)arm] != null) { return(false); } robotATM[(int)arm] = aligner; aligner = null; Save(); return(true); }
/// <summary> /// LAMI에서 ATM으로 이동 /// </summary> /// <returns></returns> public bool LoadingLamiToAtm(HAND arm, int nlami) { if (lami[nlami] == null || robotATM[(int)arm] != null) { return(false); } robotATM[(int)arm] = lami[nlami]; lami[nlami] = null; Save(); return(true); }
///// <summary> ///// Loadlock에서 VTM으로 이동 ///// </summary> ///// <param name="nSlot">Loadlock 슬롯</param> ///// <returns></returns> //public bool LoadingLoadLockToVtm(int nSlot, HAND arm) //{ // if (loadlock[nSlot] == null || robotVTM[(int)arm] != null) // return false; // robotVTM[(int)arm] = loadlock[nSlot]; // loadlock[nSlot] = null; // Save(); // return true; //} ///// <summary> ///// Loadlock에서 VTM으로 이동 ///// </summary> ///// <param name="wType">로드락 슬롯</param> ///// <returns></returns> //public bool LoadingLoadLockToVtm(WaferType wType, HAND arm) //{ // int nSlot = GetLoadlockSlot(wType); // if (loadlock[nSlot] == null || robotVTM[(int)arm] != null) // return false; // robotVTM[(int)arm] = loadlock[nSlot]; // loadlock[nSlot] = null; // Save(); // return true; //} /// <summary> /// VTM에서 Bonder로 이동 /// </summary> /// <returns></returns> public bool LoadingVtmToBonder(HAND arm) { if (robotVTM[(int)arm] == null || bonder != null) { return(false); } bonder = robotVTM[(int)arm]; robotVTM[(int)arm] = null; Save(); return(true); }
/// <summary> /// Loadlock에서 VTM으로 이동 /// </summary> /// <param name="nSlot">Loadlock 슬롯</param> /// <returns></returns> public bool LoadingLoadLockToVtm(int nSlot, HAND arm) { if (loadlock[nSlot] == null || robotVTM[(int)arm] != null) { return(false); } robotVTM[(int)arm] = loadlock[nSlot]; loadlock[0] = null; loadlock[1] = null; Save(); return(true); }
/// <summary> /// ATM에서 Loadlock으로 이동 /// </summary> /// <param name="nSlot">Loadlock 슬롯</param> /// <returns></returns> public bool LoadingAtmToLoadLock(int nSlot, HAND arm) { if (robotATM[(int)arm] == null || loadlock[nSlot] != null) { return(false); } loadlock[nSlot] = robotATM[(int)arm]; robotATM[(int)arm] = null; Save(); return(true); }
/// <summary> /// ATM에서 LAMI로 이동 /// </summary> /// <returns></returns> public bool LoadingAtmToLami(HAND arm, int nlami) { if (robotATM[(int)arm] == null || lami[nlami] != null) { return(false); } lami[nlami] = robotATM[(int)arm]; robotATM[(int)arm] = null; Save(); return(true); }
/// <summary> /// FM Robot에서 Aligner로 이동 /// </summary> /// <returns></returns> public bool LoadingFmToAligner(HAND arm) { if (robotFM[(int)arm] == null || aligner != null) { return(false); } aligner = robotFM[(int)arm]; robotFM[(int)arm] = null; Save(); return(true); }
/// <summary> /// Bonder에서 VTM으로 이동 /// </summary> /// <returns></returns> public bool LoadingBonderToVtm(HAND arm) { if (bonder == null || robotVTM[(int)arm] != null) { return(false); } robotVTM[(int)arm] = bonder; bonder = null; Save(); return(true); }
/// <summary> /// EFEM에서 FM Robot으로 이동 /// </summary> /// <param name="nSlot"></param> public bool LoadingEfemToFm(EFEM_TYPE efType, int nSlot, HAND arm) { WaferData[] wData = GetEfemData(efType); if (wData[nSlot] == null || robotFM[(int)arm] != null) { return(false); } robotFM[(int)arm] = wData[nSlot]; wData[nSlot] = null; Save(); return(true); }
/// <summary> /// FM에서 EFEM으로 이동 /// </summary> /// <param name="efType"></param> /// <param name="nSlot"></param> /// <returns></returns> public bool LoadingFmToEfem(EFEM_TYPE efType, int nSlot, HAND arm) { WaferData[] wData = GetEfemData(efType); if (robotFM[(int)arm] == null || wData[nSlot] != null) { return(false); } wData[nSlot] = robotFM[(int)arm]; robotFM[(int)arm] = null; Save(); return(true); }
/// <summary> /// ATM에서 LoadLock으로 이동 /// </summary> /// <param name="wType">Wafer Type</param> /// <returns></returns> public bool LoadingAtmToLoadLock(WaferType wType, HAND arm) { int nSlot = GetLoadlockSlot(wType); if (robotATM[(int)arm] == null || loadlock[nSlot] != null) { return(false); } loadlock[nSlot] = robotATM[(int)arm]; robotATM[(int)arm] = null; Save(); return(true); }
public void activateWeaponAttack(HAND hand, bool state) { if (hand == HAND.left) { leftHand.ActivateAttack(state); } else if (hand == HAND.right) { rightHand.ActivateAttack(state); } else { leftHand.ActivateAttack(state); rightHand.ActivateAttack(state); } }
/// <summary> /// Loadlock에서 VTM으로 이동 /// </summary> /// <param name="wType">로드락 슬롯</param> /// <returns></returns> public bool LoadingLoadLockToVtm(WaferType wType, HAND arm) { int nSlot = GetLoadlockSlot(wType); if (loadlock[nSlot] == null || robotVTM[(int)arm] != null) { return(false); } robotVTM[(int)arm] = loadlock[nSlot]; loadlock[0] = null; loadlock[1] = null; Save(); return(true); }
// Method to find which hand was displayed public HAND HandEvaluator() { HAND tempHand = HAND.AllOther; if (IsJacksOrGreater()) { tempHand = HAND.JacksOrBetter; } if (IsTwoPair()) { tempHand = HAND.TwoPair; } if (IsThreeOfAKind()) { tempHand = HAND.ThreeOfAKind; } if (IsStraight()) { tempHand = HAND.Straight; } if (IsFlush()) { tempHand = HAND.Flush; } if (IsFullHouse()) { tempHand = HAND.FullHouse; } if (IsFourOfAKind()) { tempHand = HAND.FourOfAKind; } if (IsStraightFlush()) { tempHand = HAND.StraightFlush; } if (IsRoyalFlush()) { tempHand = HAND.RoyalFlush; } return(tempHand); }
private HAND FindBestHand() { HAND bestHand = HAND.CARDVALUE; if (IsRoyalFlush()) { bestHand = HAND.ROYALFLUSH; } else if (IsStraightFlush()) { bestHand = HAND.STRAIGHTFLUSH; } else if (IsFourOfAkind()) { bestHand = HAND.FOUROFAKIND; } else if (IsFullHouse()) { bestHand = HAND.FULLHOUSE; } else if (IsFlush()) { bestHand = HAND.FLUSH; } else if (IsStraight()) { bestHand = HAND.STRAIGHT; } else if (IsThreeOfAKind()) { bestHand = HAND.THREEOFAKIND; } else if (IsTwoPairs()) { bestHand = HAND.TWOPAIRS; } else if (IsOnePair()) { bestHand = HAND.ONEPAIR; } return(bestHand); }
// ------------------------------------------- /* * AssignLaserByButtonPressed */ protected virtual void AssignLaserByButtonPressed(HAND _handSelected, GameObject _myLaserPointer) { if (m_currentHandWithLaser != _handSelected) { m_currentHandWithLaser = _handSelected; ActivateTeleportController(m_handsBeingTracked); YourVRUIScreenController.Instance.LaserPointer = _myLaserPointer.gameObject; if (m_currentHandWithLaser == HAND.right) { YourVRUIScreenController.Instance.LaserLeftPointer.SetActive(false); YourVRUIScreenController.Instance.LaserRightPointer.SetActive(true); } else { YourVRUIScreenController.Instance.LaserLeftPointer.SetActive(true); YourVRUIScreenController.Instance.LaserRightPointer.SetActive(false); } KeysEventInputController.Instance.IgnoreNextAction = true; UIEventController.Instance.DispatchUIEvent(EVENT_OCULUSHANDMANAGER_UPDATE_LASER, YourVRUIScreenController.Instance.LaserPointer, (m_currentHandWithLaser == HAND.right)); } }
public Hand(string[] fiveCardHand) { if (fiveCardHand.Count() != numCards) { throw new IllegalNumberOfCards(); } refHand = fiveCardHand; allCardValuesInOrder = GetStandardCardValues(); fiveCards = (from v in GetCardValues(fiveCardHand.ToList()) select GetEnumFromString("_" + v)).ToArray(); fiveSuits = (from s in GetCardSuits(fiveCardHand.ToList()) select(SUIT) Enum.Parse(typeof(SUIT), s.ToString())).ToArray(); stackedValues = fiveCards.GroupBy(t => t.ToString()).OrderByDescending(u => u.Count()).ToList(); stackedSuits = fiveSuits.GroupBy(t => t.ToString()).OrderByDescending(u => u.Count()).ToList(); orderedUniqueValues = new List <CARD>(fiveCards.Distinct().ToList()); orderedUniqueValues.Sort(); highestCardInRank = orderedUniqueValues.Last(); bestRankForHand = FindBestHand(); }
public bool IsBetterThan(Hand player2Hand) { HAND comparisonHandRanking = player2Hand.GetRank(); CARD comparisonHiCardInRank = player2Hand.GetHighestCardInRank(); bool isCurrentRankBest = false; if (bestRankForHand != comparisonHandRanking) { isCurrentRankBest = bestRankForHand > comparisonHandRanking; //if (isCurrentRankBest) // DisplayHandRanking(player2Hand, comparisonHandRanking, comparisonHiCardInRank, isCurrentRankBest); } else { isCurrentRankBest = highestCardInRank > comparisonHiCardInRank; //if (isCurrentRankBest) // DisplayCardRanking(player2Hand, comparisonHandRanking, comparisonHiCardInRank, isCurrentRankBest); } return(isCurrentRankBest); }
private void btnPickup_Click(object sender, EventArgs e) { if (!ShowDialog()) { return; } if (cbUnitSel.SelectedIndex < 0 || m_nSelectSource < 0) { return; } bool bFail = false; ManualUnit Unit = (ManualUnit)m_nSelectSource; HAND arm = HAND.LOWER; if (cbArmSel.SelectedIndex == 0) { arm = HAND.LOWER; } else { arm = HAND.UPPER; } ManualRun.MANUAL_SEQ Manul_Seq = ManualRun.MANUAL_SEQ.NONE; switch (cbUnitSel.SelectedIndex) { case 0: //FM Robot GlobalVariable.manualInfo.SelArmFM = arm; GlobalVariable.manualInfo.nSlotSource = Convert.ToInt32(cbSlotSource.Text); switch (Unit) { case ManualUnit.LPMA: GlobalVariable.manualInfo.mnlStageFM = FMStage.LPMA; Manul_Seq = ManualRun.MANUAL_SEQ.FMRobot_Pickup_LPM; break; case ManualUnit.LPMB: GlobalVariable.manualInfo.mnlStageFM = FMStage.LPMB; Manul_Seq = ManualRun.MANUAL_SEQ.FMRobot_Pickup_LPM; break; case ManualUnit.LPMC: GlobalVariable.manualInfo.mnlStageFM = FMStage.LPMC; Manul_Seq = ManualRun.MANUAL_SEQ.FMRobot_Pickup_LPM; break; case ManualUnit.LPMD: GlobalVariable.manualInfo.mnlStageFM = FMStage.LPMD; Manul_Seq = ManualRun.MANUAL_SEQ.FMRobot_Pickup_LPM; break; case ManualUnit.CP1: GlobalVariable.manualInfo.mnlStageFM = FMStage.CP1; Manul_Seq = ManualRun.MANUAL_SEQ.FMRobot_Pickup_Buffer; break; case ManualUnit.CP2: GlobalVariable.manualInfo.mnlStageFM = FMStage.CP2; Manul_Seq = ManualRun.MANUAL_SEQ.FMRobot_Pickup_Buffer; break; case ManualUnit.CP3: GlobalVariable.manualInfo.mnlStageFM = FMStage.CP3; Manul_Seq = ManualRun.MANUAL_SEQ.FMRobot_Pickup_Buffer; break; default: bFail = true; break; } break; case 1: //ATM Robot GlobalVariable.manualInfo.SelArmATM = arm; GlobalVariable.manualInfo.nSlotSource = Convert.ToInt32(cbSlotSource.Text); switch (Unit) { case ManualUnit.AL: GlobalVariable.manualInfo.mnlStageATM = AtmStage.ALIGN; Manul_Seq = ManualRun.MANUAL_SEQ.ATMRobot_Pickup_Buffer; break; case ManualUnit.HP: GlobalVariable.manualInfo.mnlStageATM = AtmStage.HP; Manul_Seq = ManualRun.MANUAL_SEQ.ATMRobot_Pickup_Buffer; break; case ManualUnit.LAMI: GlobalVariable.manualInfo.mnlStageATM = AtmStage.LAMI_ULD; Manul_Seq = ManualRun.MANUAL_SEQ.ATMRobot_Unload_Lami; break; case ManualUnit.LL_BD: GlobalVariable.manualInfo.mnlStageATM = AtmStage.BD; Manul_Seq = ManualRun.MANUAL_SEQ.ATMRobot_Place_Loadlock; break; default: bFail = true; break; } break; case 2: //VTM Robot GlobalVariable.manualInfo.SelArmVTM = arm; GlobalVariable.manualInfo.nSlotSource = Convert.ToInt32(cbSlotSource.Text); switch (Unit) { case ManualUnit.LL1_DIV: GlobalVariable.manualInfo.mnlStageVTM = VtmStage.LL; Manul_Seq = ManualRun.MANUAL_SEQ.VTMRobot_Pickup_Loadlock; break; case ManualUnit.LL2_CARR: GlobalVariable.manualInfo.mnlStageVTM = VtmStage.LL; Manul_Seq = ManualRun.MANUAL_SEQ.VTMRobot_Pickup_Loadlock; break; case ManualUnit.PMC: GlobalVariable.manualInfo.mnlStageVTM = VtmStage.PMC1_ULD; Manul_Seq = ManualRun.MANUAL_SEQ.VTMRobot_Unload_PMC; break; default: bFail = true; break; } break; default: bFail = true; break; //매뉴얼 동작 스타트 GlobalSeq.manualRun.StartManualSeq(Manul_Seq); } }