Beispiel #1
0
    // Hand추가, 카드 나눔, 배팅 추가,
    // 스플릿 후 핸드 각각에 한장의 카드를 줄때
    // 각각의 핸드에 접근을 해야한다 그런데
    // 핸드 접근방법이 단방향 인덱싱이기 때문에(양방향 할수도있지만 가독성, 안전성을 위해)
    // 2번째 핸드의 객체를 인자로 전달받아서 접근한다
    public PlayerHand Split()
    {
        bool isDoubleAce = GetCurrentHand.IsDoubleAce;

        Card card = GetCurrentHand.Pop();

        card.DisHighlight();
        int bet = GetCurrentHand.AmountOfBetting;

        Budget -= bet;

        // 추가한 핸드
        PlayerHand splitHand = AddHand();

        if (isDoubleAce)
        {
            GetCurrentHand.SetSplitAce();
            splitHand.SetSplitAce();
        }

        // 그 핸드에 정보 전달
        splitHand.Push(card, false);
        card.transform.position = splitHand.transform.position;
        splitHand.Betting(bet);

        return(splitHand);
    }
Beispiel #2
0
    public void Surrender()
    {
        int half = GetCurrentHand.AmountOfBetting / 2; // 반토막 가져옴

        GetCurrentHand.SurrenderBetting();             // 배팅 없앰

        // 계좌 추가
        account.AmountOfAccount += half; // 계좌로 회수
    }
Beispiel #3
0
    public void DoubleDown()
    {
        int half = GetCurrentHand.AmountOfBetting; // 배팅할 금액

        // 배팅
        GetCurrentHand.DoubleDownBetting();

        // 계좌 차감
        Budget -= half;
    }
Beispiel #4
0
    // 이동, 핸드.추가함수() 호출
    public void GetOpenCard(Card card, float delay)
    {
        card.Move(GetCurrentHand.transform, delay);
        card.Rotate(delay);

        bool isFirstHand = false;

        if (hands.Count == 1 && hands[0].GetCardCount < 2)
        {
            isFirstHand = true;
        }

        GetCurrentHand.Push(card, isFirstHand); // (in)카드 하이라이트 +
    }
Beispiel #5
0
    public bool UpdateAndCheckAllPossibleHand()
    {
        GetCurrentHand.DisHighlight();
        ++currentHandIndex;

        while (currentHandIndex < hands.Count)
        {
            if (GetCurrentHand.IsStopChoice == false)
            {
                GetCurrentHand.Highlight(0.0f);
                return(true);
            }

            ++currentHandIndex;
        }
        currentHandIndex = 0;
        return(false);
    }
Beispiel #6
0
    public AI_PlayerHand Split(bool isAce)
    {
        AI_Card card = GetCurrentHand.Pop();
        float   bet  = GetCurrentHand.AmountOfBetting;

        AI_PlayerHand splitHand = AddHand();

        if (isAce)
        {
            GetCurrentHand.SetSplitAce();
            splitHand.SetSplitAce();
        }

        // 그 핸드에 정보 전달
        splitHand.Push(card, false);
        splitHand.Betting();

        return(splitHand);
    }
Beispiel #7
0
 public void DoubleDown()
 {
     GetCurrentHand.DoubleDownBetting();
 }