Esempio n. 1
0
File: Loot.cs Progetto: etomsky/Loot
    public bool CheckGameOver()
    {
        // See if we need to reshuffle the discard pile into the draw pile
        if (drawPile.Count == 0)
        {
            List <Card> cards = new List <Card>();
            foreach (CardLoot cl in discardPile)
            {
                cards.Add(cl);
            }
            discardPile.Clear();
            LootDeck.Shuffle(ref cards);
            drawPile = UpgradeCardsList(cards);
            ArrangeDrawPile();
        }

        // Check to see if the current player has won
        if (CURRENT_PLAYER.hand.Count == 0)
        {
            // The player that just played has won!
            phase = TurnPhase.gameOver;
            Invoke("RestartGame", 1);
            return(true);
        }
        return(false);
    }
Esempio n. 2
0
File: Loot.cs Progetto: etomsky/Loot
    private void Start()
    {
        lootDeck = GetComponent <LootDeck>(); // Get the Deck
        lootDeck.InitDeck(lootDeckXML.text);
        LootDeck.Shuffle(ref lootDeck.cards);

        layout = GetComponent <LootLayout>(); // Get the Layout
        layout.ReadLayout(lootLayoutXML.text);

        drawPile = UpgradeCardsList(lootDeck.cards);
        LayoutGame();
    }