protected IntRect GetBuildingRectangle(ITile centerTile, BuildingType buildingType) { IntVector2 topLeft = centerTile.TopLeft - buildingType.Size / 2; IntVector2 bottomRight = buildingType.GetBottomRightTileIndex(topLeft); Map.SnapToMap(ref topLeft, ref bottomRight); return(new IntRect(topLeft.X, topLeft.Y, bottomRight.X, bottomRight.Y)); }
void GetBuildingRectangle(ITile centerTile, BuildingType buildingType, out IntVector2 topLeft, out IntVector2 bottomRight) { topLeft = centerTile.TopLeft - buildingType.Size / 2; bottomRight = buildingType.GetBottomRightTileIndex(topLeft); Map.SnapToMap(ref topLeft, ref bottomRight); }