10 private delegate
bool SlabState(
int x,
int y,
int scale);
14 public static bool Empty(
int x,
int y,
int scale)
19 public static bool Solid(
int x,
int y,
int scale)
24 public static bool HalfBrick(
int x,
int y,
int scale)
26 return y >= scale / 2;
31 return x >= scale - y;
88 switch (((isSolid ? 1 : 0) << 3) | ((isSolid2 ? 1 : 0) << 2) | ((isSolid3 ? 1 : 0) << 1) | (isSolid4 ? 1 : 0))
122 int num3 = scale + 1;
125 for (
int i = num2; i < num3; i++)
139 for (
int j = num4; j < num5; j++)
143 bool active = slab.
State(i, j, scale);
167 for (
int i = 0; i < scale; i++)
169 for (
int j = 0; j < scale; j++)
177 return num > scale / 4 * 3;
193 origin.X -= num * 3 / 2;
194 origin.Y -= num2 * 3 / 2;
195 for (
int i = -1; i < num + 1; i++)
197 double num4 = (double)(i - num / 2) / (double)num + 0.5;
198 int num5 = (int)((0.5 -
Math.
Abs(num4 - 0.5)) * 5.0) - 2;
199 for (
int j = -1; j < num2 + 1; j++)
204 int num6 =
Math.
Abs(j - num2 / 2) - num3 / 4 + num5;
212 flag = j - num2 / 2 > 0 || flag2;
213 hasWall = j - num2 / 2 < 0 || num6 <= 2;
217 flag =
GenBase.
_random.Next(2) == 0 && (j - num2 / 2 > 0 || flag2);
227 for (
int k = 0; k < num; k++)
229 for (
int l = 0; l < num2; l++)
236 int num9 = (num8 + 1) * (num8 + 1);
241 for (
int m = 0; m <= num; m++)
243 double num12 = (double)num8 / (
double)num7 * (double)(m - num7);
245 num11 = ((m >= num / 2) ? (num11 +
Utils.
Lerp(num10, value2, (
double)m / (
double)(num / 2) - 1.0)) : (num11 +
Utils.
Lerp(
value, num10, (
double)m / (
double)(num / 2))));
246 for (
int n = num8 - num13; n <= num8 + num13; n++)
248 PlaceSlab(
_slabs[m + 1, n + 1], m * 3 + origin.
X, n * 3 + origin.
Y + (
int)num11, 3);
static byte Min(byte val1, byte val2)
static double Sqrt(double d)
static double Abs(double value)
static byte Max(byte val1, byte val2)
static bool Empty(int x, int y, int scale)
static bool Solid(int x, int y, int scale)
static bool HalfBrick(int x, int y, int scale)
static bool TopRightFilled(int x, int y, int scale)
static bool BottomLeftFilled(int x, int y, int scale)
static bool BottomRightFilled(int x, int y, int scale)
static bool TopLeftFilled(int x, int y, int scale)
static bool IsGroupSolid(int x, int y, int scale)
delegate bool SlabState(int x, int y, int scale)
override bool Place(Point origin, StructureMap structures)
void SmoothSlope(int x, int y)
void PlaceSlab(Slab slab, int originX, int originY, int scale)
static void SmoothSlope(int x, int y, bool applyToNeighbors=true, bool sync=false)
void ResetToType(ushort type)
static double Lerp(double value1, double value2, double amount)
static UnifiedRandom _random
void AddStructure(Rectangle area, int padding=0)
static void TileFrame(int x, int y, bool frameNeighbors=false)
static bool BiomeTileCheck(int x, int y)
static bool SolidTile(Tile testTile)
static UnifiedRandom genRand
static void SquareWallFrame(int i, int j, bool resetFrame=true)
static bool drunkWorldGen
static void PlaceTight(int x, int y, bool spiders=false)
static bool SolidOrSlopedTile(Tile tile)
static Slab Create(SlabState state, bool hasWall)
Slab(SlabState state, bool hasWall)
Slab WithState(SlabState state)