Пример #1
0
 public void StartNewGame()
 {
     TotalMeBetTai = 0;
     TotalMeBetXiu = 0;
     Result        = null;
     WinResult     = null;
 }
Пример #2
0
    public void UpdateInfo(SRSTaiXiuSessionInfo sessionInfo)
    {
        SessionID    = sessionInfo.SessionID;
        CurrentState = (TaiXiuGameState)sessionInfo.CurrentState;
        Ellapsed     = sessionInfo.Ellapsed;
        TotalTai     = sessionInfo.TotalTai;
        TotalXiu     = sessionInfo.TotalXiu;
        TotalBetTai  = sessionInfo.TotalBetTai;
        TotalBetXiu  = sessionInfo.TotalBetXiu;

        Result           = sessionInfo.Result;
        Result.SessionId = SessionID;
    }
Пример #3
0
 public SRSTaiXiu()
 {
     Histories = new List <SRSTaiXiuDice>();
     Result    = null;
 }
Пример #4
0
    public void UpdateResult(SRSTaiXiuDice item)
    {
        tais = new int[3];
        xius = new int[3];

        // reload stt1
        lastPointStt1  = -1;
        lastColStt1    = -1;
        lastRowStt1    = 0;
        totalPointStt1 = new List <int>();
        uiDotStt1.ForEach(a => Destroy(a.gameObject));
        uiDotStt1.Clear();
        for (int i = 0; i < histories.Count; i++)
        {
            int total = histories[i].Point;

            AddDot1(total, i);
            if (lastColStt1 > 22)
            {
                break;
            }
        }

        // reload stt2
        for (int i = 0; i < uiDotStt2.Count; i++)
        {
            int total = histories[i].Point;
            uiDotStt2[i].InitDot2(sprDots2[total > 10 ? 1 : 0]);

            if (total > 10)
            {
                tais[1]++;
            }
            else
            {
                xius[1]++;
            }
        }

        txtTais[0].text = ": " + tais[0];
        txtXius[0].text = xius[0] + " :";
        txtTais[1].text = ": " + tais[1];
        txtXius[1].text = xius[1] + " :";

        // reload stt3
        lastTranStt3 = null;
        for (int i = 0; i < uiDotStt3.Count; i++)
        {
            var dot   = uiDotStt3[i];
            int total = histories[i].Point;

            float y = (vDot3.y * total);

            dot.transform.localPosition = new Vector3(dot.transform.localPosition.x, y, 0f);
            dot.InitDot3(total, sprDots3[total > 10 ? 1 : 0], lastTranStt3);

            lastTranStt3 = dot.transform;
        }

        // reload stt4
        lastTranStt4Num1 = null;
        lastTranStt4Num2 = null;
        lastTranStt4Num3 = null;
        for (int i = 0; i < uiDotStt4_1.Count; i++)
        {
            var dot1 = uiDotStt4_1[i];
            var dot2 = uiDotStt4_2[i];
            var dot3 = uiDotStt4_3[i];

            var data = histories[i];

            // dice1
            float y = (vDot4.y * data.Dice1);
            dot1.transform.localPosition = new Vector3(dot1.transform.localPosition.x, y, 0f);
            dot1.InitDot4(data.Dice1, cDots4[0], lastTranStt4Num1);

            // dice2
            y = (vDot4.y * data.Dice2);
            dot2.transform.localPosition = new Vector3(dot2.transform.localPosition.x, y, 0f);
            dot2.InitDot4(data.Dice2, cDots4[1], lastTranStt4Num2);

            // dice3
            y = (vDot4.y * data.Dice3);
            dot3.transform.localPosition = new Vector3(dot3.transform.localPosition.x, y, 0f);
            dot3.InitDot4(data.Dice3, cDots4[2], lastTranStt4Num3);

            lastTranStt4Num1 = dot1.transform;
            lastTranStt4Num2 = dot2.transform;
            lastTranStt4Num3 = dot3.transform;
        }
    }