public AssetTuple getAssetTupleForTile(GameTile tile, int numCollected) { ResourceTuple resources = getResourceForTile(tile, numCollected); CommodityTuple commodities = getCommodityForTile(tile, numCollected); return(new AssetTuple(resources, commodities)); }
public AssetTuple(ResourceTuple resourceTuple, CommodityTuple commodityTuple, FishTuple fishTuple, int gold) { this.resources = resourceTuple; this.commodities = commodityTuple; this.fishTokens = fishTuple; this.gold = gold; }
public AssetTuple(int brick, int grain, int lumber, int ore, int wool, int paper, int coin, int cloth, int oneTokens, int twoTokens, int threeTokens, int oldBoot, int gold) { resources = new ResourceTuple(brick, grain, lumber, ore, wool); commodities = new CommodityTuple(paper, coin, cloth); fishTokens = new FishTuple(oneTokens, twoTokens, threeTokens, oldBoot); this.gold = gold; }
public AssetTuple(ResourceTuple resourceTuple, CommodityTuple commodityTuple) { this.resources = resourceTuple; this.commodities = commodityTuple; this.fishTokens = new FishTuple(); this.gold = 0; }
public AssetTuple(int brick, int grain, int lumber, int ore, int wool, int paper, int coin, int cloth) { resources = new ResourceTuple(brick, grain, lumber, ore, wool); commodities = new CommodityTuple(paper, coin, cloth); fishTokens = new FishTuple(0, 0, 0); this.gold = 0; }
public AssetTuple() { resources = new ResourceTuple(); commodities = new CommodityTuple(); fishTokens = new FishTuple(); this.gold = 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); }
public void spendCommodities(CommodityTuple commodityToSpend) { List <CommodityType> commodityKeys = new List <CommodityType>(assets.commodities.commodityTuple.Keys); for (int i = 0; i < commodityKeys.Count; i++) { if (assets.commodities.commodityTuple [commodityKeys [i]] >= commodityToSpend.commodityTuple [commodityKeys [i]]) { print("Subtracted " + commodityToSpend.commodityTuple [commodityKeys [i]].ToString() + " " + commodityKeys [i].ToString() + " from " + this.playerName); assets.commodities.commodityTuple [commodityKeys [i]] -= commodityToSpend.commodityTuple [commodityKeys [i]]; } } }
public void receiveCommodities(CommodityTuple commodityToAdd) { List <CommodityType> commodityKeys = new List <CommodityType>(assets.commodities.commodityTuple.Keys); for (int i = 0; i < commodityKeys.Count; i++) { if (commodityToAdd.commodityTuple [commodityKeys [i]] >= 0) { print("Added " + commodityToAdd.commodityTuple [commodityKeys [i]].ToString() + " " + commodityKeys [i].ToString() + " to " + this.playerName); assets.commodities.commodityTuple [commodityKeys [i]] += commodityToAdd.commodityTuple [commodityKeys [i]]; } } }
public bool hasAvailableCommodities(CommodityTuple commoditiesNeeded) { List <CommodityType> commodityKeys = new List <CommodityType>(assets.commodities.commodityTuple.Keys); for (int i = 0; i < commodityKeys.Count; i++) { if (assets.commodities.commodityTuple [commodityKeys [i]] < commoditiesNeeded.commodityTuple [commodityKeys [i]]) { return(false); } } return(true); }
public AssetTuple nextImprovementCost(CityImprovementType improvementType) { CommodityTuple commodityCost = new CommodityTuple(); if (cityImprovements [improvementType] < 5) { if (playedCraneThisTurn) { commodityCost.addCommodityWithType(upgradeCommodityChart [improvementType], cityImprovements [improvementType]); } else { commodityCost.addCommodityWithType(upgradeCommodityChart [improvementType], cityImprovements [improvementType] + 1); } } return(new AssetTuple(new ResourceTuple(), commodityCost)); }
void giveCommoditiesToPlayer(Player player, CommodityTuple commodityObtained) { player.receiveCommodities(commodityObtained); }