public override int getCostToPlay() /* Use this card's normal cost, except double it if any of the squares it will be on are * stained. * * See getCostToPlay on base class Card. */ { Vector2 mouseDownSquare = (Vector2)TrialLogic.mouseDownGridIndices; Vector2 mouseUpSquare = (Vector2)TrialLogic.mouseUpGridIndices; int costToPlace = iumCost; foreach (Vector2 square in getSquaresToPlaceOn(mouseDownSquare, mouseUpSquare)) { if (TrialLogic.floorSquaresMap.ContainsKey(square)) { FloorSquare floorSquare = TrialLogic.floorSquaresMap[square]; if (floorSquare.isStained()) { costToPlace *= 2; break; } } } return(costToPlace); }
public override int getCostToPlay() /* Use this card's normal cost, except double it if the targeted square is stained. * * See getCostToPlay on base class Card. */ { int costToPlace = iumCost; Vector2 gridIndices = (Vector2)TrialLogic.mouseDownGridIndices; FloorSquare floorSquare = TrialLogic.floorSquaresMap[gridIndices]; if (floorSquare.isStained()) { costToPlace *= 2; } return(costToPlace); }