Exemplo n.º 1
0
    CommodityTuple getCommodityForTile(GameTile tile, int numCollected)
    {
        CommodityTuple commodityCollected = new CommodityTuple();
        CommodityType  typeOfCommodity    = GameAsset.getCommodityOfHex(tile.tileType);

        if (typeOfCommodity != CommodityType.Null)
        {
            commodityCollected.commodityTuple [typeOfCommodity] = numCollected;
        }

        return(commodityCollected);
    }
Exemplo n.º 2
0
    void commodityCollectionEvent(int diceOutcome)
    {
        for (int i = 0; i < players.Count; i++)
        {
            if (setupPhase && i != currentPlayerTurn)
            {
                continue;
            }
            else
            {
                List <GameTile> eligibleTilesForPlayer = getTilesWithDiceValue(players [i], diceOutcome, true);

                for (int j = 0; j < eligibleTilesForPlayer.Count; j++)
                {
                    if (eligibleTilesForPlayer [j].canProduce())
                    {
                        print(players [i].playerName + " gets " + "1 " + GameAsset.getCommodityOfHex(eligibleTilesForPlayer [j].tileType));
                        //giveResourcesToPlayer (players [i], getResourceForTile (eligibleTilesForPlayer [j], 1));
                        giveCommoditiesToPlayer(players[i], getCommodityForTile(eligibleTilesForPlayer[j], 1));
                    }
                }
            }
        }
    }