예제 #1
0
        private bool AlreadyLeadsIntoWantedTrack(
            Point tileCoordsOfFrontWheel,
            Point tileCoordsWeWantToReach)
        {
            Tile tileSafely1 = Framing.GetTileSafely(tileCoordsOfFrontWheel);
            Tile tileSafely2 = Framing.GetTileSafely(tileCoordsWeWantToReach);

            if (!tileSafely1.active() || tileSafely1.type != (ushort)314 || (!tileSafely2.active() || tileSafely2.type != (ushort)314))
            {
                return(false);
            }
            int?expectedStartLeft;
            int?expectedStartRight;
            int?expectedEndLeft;
            int?expectedEndRight;

            MinecartDiggerHelper.GetExpectedDirections(tileCoordsOfFrontWheel, tileCoordsWeWantToReach, out expectedStartLeft, out expectedStartRight, out expectedEndLeft, out expectedEndRight);
            return(Minecart.GetAreExpectationsForSidesMet(tileCoordsOfFrontWheel, expectedStartLeft, expectedStartRight) && Minecart.GetAreExpectationsForSidesMet(tileCoordsWeWantToReach, expectedEndLeft, expectedEndRight));
        }
예제 #2
0
        private void CorrectTrackConnections(Point startCoords, Point endCoords)
        {
            int?expectedStartLeft;
            int?expectedStartRight;
            int?expectedEndLeft;
            int?expectedEndRight;

            MinecartDiggerHelper.GetExpectedDirections(startCoords, endCoords, out expectedStartLeft, out expectedStartRight, out expectedEndLeft, out expectedEndRight);
            Tile tileSafely1 = Framing.GetTileSafely(startCoords);
            Tile tileSafely2 = Framing.GetTileSafely(endCoords);

            if (tileSafely1.active() && tileSafely1.type == (ushort)314)
            {
                Minecart.TryFittingTileOrientation(startCoords, expectedStartLeft, expectedStartRight);
            }
            if (!tileSafely2.active() || tileSafely2.type != (ushort)314)
            {
                return;
            }
            Minecart.TryFittingTileOrientation(endCoords, expectedEndLeft, expectedEndRight);
        }