コード例 #1
0
        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));
        }
コード例 #2
0
 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);
 }