public byte GetBrick(int y, float mountainValue, float blobValue, Chunk chunk) { BrickLayer bestBid = null; float bestBidValue = 0; foreach (BrickLayer brickLayer in brickLayers) { float bidValue = brickLayer.Bid(y, mountainValue, blobValue, chunk); if (bidValue > bestBidValue) { bestBidValue = bidValue; bestBid = brickLayer; } } if (bestBid == null) { return(0); } else { return((byte)bestBid.brickType); } }
public byte GetBrick(int y, float mountainValue, float blobValue, float moisture, float rockiness) { BrickLayer bestBidder = null; float bestBid = 0; for (int a = 0; a < brickLayers.Length; a++) { float bid = brickLayers[a].Bid(y, mountainValue, blobValue, moisture, rockiness); if (bid > bestBid) { bestBid = bid; bestBidder = brickLayers[a]; } } if (bestBidder == null) { return(0); } else { return((byte)bestBidder.brick); } }