31 [DebuggerDisplay(
"X = {X}, Y = {Y}, Slope = {Slope}")]
53 7, 94, 95, 8, 98, 99, 9, 96, 97, 3,
54 83, 68, 62, 78, 87, 86, 42, 74, 27, 149
59 383, 384, 15, 304, 30, 321, 245, 246, 240, 241,
60 242, 16, 34, 158, 377, 94, 10, 19, 86, 219,
74 public bool Place(
Point origin,
int minLength,
int maxLength)
74 public bool Place(
Point origin,
int minLength,
int maxLength) {
…}
92 for (
int i = 0; i <
_length; i++)
119 for (
int k = 0; k <
_length; k++)
128 bool wire =
Main.
tile[trackHistory.
X, trackHistory.
Y].wire();
131 Main.
tile[trackHistory.
X, trackHistory.
Y].ClearEverything();
136 Main.
tile[trackHistory.
X, trackHistory.
Y].ResetToType(314);
138 Main.
tile[trackHistory.
X, trackHistory.
Y].wire(wire);
143 for (
int l = 0; l < 8; l++)
159 _xDirection = ((origin.X <= Main.maxTilesX / 2) ? 1 : (-1));
161 for (
int i = 0; i <
_history.Length; i++)
167 private bool FindPath(
int minLength,
int maxLength)
181 while (trackPlacementState2 != 0)
214 for (
int i = 1; i < num; i++)
217 switch (trackPlacementState2)
220 trackSlope = trackSlope2;
222 trackPlacementState = trackPlacementState2;
233 trackSlope = trackSlope2;
235 trackPlacementState = trackPlacementState2;
243 for (
int j = 1; j < num; j++)
247 return trackPlacementState;
261 for (
int i = 0; i < num2; i++)
272 return historySegmentPlacementState;
289 return historySegmentPlacementState2;
294 for (
int j = 0; j < num2; j++)
318 switch (trackPlacementState)
321 return trackPlacementState;
325 result = trackPlacementState;
337 for (
int num2 =
_length - 1; num2 >= 0; num2--)
341 num =
Math.
Min(num2 + 15, num);
368 if (leftSlope != rightSlope && leftSlope != 0)
392 for (
int i = 0; i < 6; i++)
399 for (
int j = 0; j < 6; j++)
406 for (
int k = 0; k < 6; k++)
459 for (
int k = -1; k <= 1; k++)
469 [Conditional(
"DEBUG")]
static byte Min(byte val1, byte val2)
static double Abs(double value)
readonly TrackHistory[] _rewriteHistory
bool Place(Point origin, int minLength, int maxLength)
readonly TrackHistory[] _history
static TrackPlacementState CalculateStateForLocation(int x, int y)
TrackPlacementState TryRewriteHistoryToAvoidTiles()
void RewriteSlopeDirection(int index, TrackSlope slope)
static bool IsLocationInvalid(int x, int y)
void AppendToHistory(TrackSlope slope, TrackMode mode=TrackMode.Normal)
void CreateTrackStart(Point origin)
static bool CanSlopesTouch(TrackSlope leftSlope, TrackSlope rightSlope)
bool FindPath(int minLength, int maxLength)
static bool FindSuitableOrigin(ref Point origin)
TrackPlacementState CreateTunnel()
static readonly ushort[] InvalidTiles
static readonly ushort[] InvalidWalls
static bool IsMinecartTrack(int x, int y)
TrackPlacementState GetHistorySegmentPlacementState(int startIndex, int length)
static bool[] GeneralPlacementTiles
static double worldSurface
static int UnderworldLayer
static void SmoothSlope(int x, int y, bool applyToNeighbors=true, bool sync=false)
static Vector2D shimmerPosition
static void TileFrame(int x, int y, bool frameNeighbors=false)
static bool SolidTile(Tile testTile)
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static readonly int shimmerSafetyDistance
static bool PlaceTile(int i, int j, int Type, bool mute=false, bool forced=false, int plr=-1, int style=0)
static UnifiedRandom genRand
static bool oceanDepths(int x, int y)
static bool IsTileNearby(int x, int y, int type, int distance)
TrackHistory(int x, int y, TrackSlope slope)