Esempio n. 1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         hand  = GameObject.Find("Hand");
         hands = hand.GetComponent <HandsOnline>();
         Display();
         //grave = hands.GetGrave();
     }
 }
Esempio n. 2
0
    public void NextDrawnPlayer()   //常にNextTurnPlayer()が先に呼び出されるようにする必要がある
    {
        int nextD = 0;

        hand  = GameObject.Find("Hand");
        hands = hand.GetComponent <HandsOnline>();
        switch (CountWinners())
        {
        case 0:
            nextD = (turnPlayer + 3) % 4;
            break;

        case 1:
            if (hands.hands[(turnPlayer + 3) % 4].Count == 0)
            {
                nextD = (turnPlayer + 2) % 4;
            }
            else
            {
                nextD = (turnPlayer + 3) % 4;
            }
            break;

        case 2:
            if (hands.hands[(turnPlayer + 3) % 4].Count == 0)
            {
                if (hands.hands[(turnPlayer + 2) % 4].Count == 0)
                {
                    nextD = (turnPlayer + 1) % 4;
                }
                else
                {
                    nextD = (turnPlayer + 2) % 4;
                }
            }
            else
            {
                nextD = (turnPlayer + 3) % 4;
            }
            break;

        default:
            for (int pl = 0; pl < 4; pl++)
            {
                if (hands.hands[pl].Count != 0)
                {
                    nextD = pl;
                }
            }
            break;
        }
        preDrawnPlayer = drawnPlayer;
        drawnPlayer    = nextD;
    }
Esempio n. 3
0
 public void updateField()
 {
     initSources();
     hands = GetComponent <HandsOnline>();
     distribute();
     Center();
     foreach (GameObject source in sources)
     {
         source.name = "Card" + source.GetComponent <CardModel>().cardIndex;
     }
 }
Esempio n. 4
0
    //void OnGUI()
    //{
    //    if (GUI.Button(new Rect(120, 10, 100, 20), "distribute"))
    //    {
    //        initSources();
    //        hands = GetComponent<Hands>();
    //        distribute();
    //        Center();
    //        foreach (GameObject source in sources)
    //        {
    //            source.name = "Card" + source.GetComponent<CardModel>().cardIndex;
    //        }
    //    }
    //}

    public void StartGame()
    {
        initSources();
        hands = GetComponent <HandsOnline>();
        distribute();
        Center();
        foreach (GameObject source in sources)
        {
            source.name = "Card" + source.GetComponent <CardModel>().cardIndex;
        }
        zizikaku = GameObject.Find("GameManager").GetComponent <ZiziKakuOnline>();
    }
Esempio n. 5
0
 void get()
 {
     gameManager    = GameObject.Find("GameManager");
     draw           = gameManager.GetComponent <DrawOnline>();
     turnManager    = gameManager.GetComponent <TurnManagerOnline>();
     turnPlayer     = turnManager.turnPlayer;
     drawnPlayer    = turnManager.drawnPlayer;
     preDrawnPlayer = turnManager.preDrawnPlayer;
     drawnCard      = turnManager.drawnCard;
     hand           = GameObject.Find("Hand"); //Handのクラスを取得
     hands          = hand.GetComponent <HandsOnline>();
     cardModel      = GetComponent <CardModel>();
     cardIndex      = cardModel.cardIndex; //カードモデルからcardIndexを取得
 }
Esempio n. 6
0
 private void get()
 {
     //card = GameObject.Find("Card");
     turnManager = GetComponent <TurnManagerOnline>();
     record      = GetComponent <RecordOnline>();
     turn        = turnManager.turn;
     tP          = turnManager.turnPlayer;
     dP          = turnManager.drawnPlayer;
     hand        = GameObject.Find("Hand"); //Handのクラスを取得
     hands       = hand.GetComponent <HandsOnline>();
     for (int i = 0; i < numOfComs; i++)
     {
         coms[numOfPlayer + i] = GameObject.Find("Com" + (numOfPlayer + i)).GetComponent <ComputerOnline>();
         //Debug.Log("Com" + (i + 1));
     }
 }
Esempio n. 7
0
 private void get()
 {
     //card = GameObject.Find("Card");
     turnManager = GetComponent <TurnManagerOnline>();
     record      = GetComponent <RecordOnline>();
     turn        = turnManager.turn;
     tP          = turnManager.turnPlayer;
     dP          = turnManager.drawnPlayer;
     hand        = GameObject.Find("Hand"); //Handのクラスを取得
     hands       = hand.GetComponent <HandsOnline>();
     md          = GameObject.Find("ModeData").GetComponent <ModeData>();
     zizikaku    = GetComponent <ZiziKakuOnline>();
     for (int i = 0; i < 4; i++)
     {
         coms[i] = GameObject.Find("Com" + (i)).GetComponent <ComputerVer2Online>();
         //Debug.Log("Com" + (i + 1));
     }
 }
Esempio n. 8
0
 public void updateField()
 {
     initSources();
     hands = GetComponent <HandsOnline>();
     distribute();
     Center();
     foreach (GameObject source in sources)
     {
         CardModel cm    = source.GetComponent <CardModel>();
         int       index = cm.cardIndex;
         source.name = "Card" + index;
         if (zizikaku.InGuessList(index))
         {
             cm.ToggleZizikaku();
             cm.ToggleFace(true);
         }
     }
 }
Esempio n. 9
0
    public void NextTurnPlayer()
    {
        hand  = GameObject.Find("Hand");
        hands = hand.GetComponent <HandsOnline>();
        int nextT = 0;

        switch (CountWinners())
        {
        case 0:
            nextT = (turnPlayer + 1) % 4;
            break;

        case 1:
            if (hands.hands[turnPlayer].Count == 0 || hands.hands[(turnPlayer + 1) % 4].Count == 0)
            {
                nextT = (turnPlayer + 2) % 4;
            }
            else
            {
                nextT = (turnPlayer + 1) % 4;
            }
            break;

        case 2:
            if (hands.hands[turnPlayer].Count == 0)
            {
                if (hands.hands[(turnPlayer + 2) % 4].Count == 0 || hands.hands[(turnPlayer + 1) % 4].Count == 0)
                {
                    nextT = (turnPlayer + 3) % 4;
                }
                else
                {
                    nextT = (turnPlayer + 2) % 4;
                }
            }
            else
            {
                if (hands.hands[(turnPlayer + 1) % 4].Count == 0 && hands.hands[(turnPlayer + 2) % 4].Count == 0)
                {
                    nextT = (turnPlayer + 3) % 4;
                }
                if (hands.hands[(turnPlayer + 1) % 4].Count == 0 && hands.hands[(turnPlayer + 3) % 4].Count == 0)
                {
                    nextT = (turnPlayer + 2) % 4;
                }
                if (hands.hands[(turnPlayer + 2) % 4].Count == 0 && hands.hands[(turnPlayer + 3) % 4].Count == 0)
                {
                    nextT = (turnPlayer + 1) % 4;
                }
            }
            break;

        default:
            for (int pl = 0; pl < 4; pl++)
            {
                if (hands.hands[pl].Count != 0)
                {
                    nextT = pl;
                }
            }
            break;
        }
        turnPlayer = nextT;
    }
Esempio n. 10
0
 private void get()
 {
     Hand  = GameObject.Find("Hand");
     hands = Hand.GetComponent <HandsOnline>();
 }
Esempio n. 11
0
 public void updateSource()
 {
     hand  = GameObject.Find("Hand");
     hands = hand.GetComponent <HandsOnline>();
     Display();
 }