Esempio n. 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));
        }
Esempio n. 2
0
        private bool AlreadyLeadsIntoWantedTrack(Point tileCoordsOfFrontWheel, Point tileCoordsWeWantToReach)
        {
            Tile tileSafely  = Framing.GetTileSafely(tileCoordsOfFrontWheel);
            Tile tileSafely2 = Framing.GetTileSafely(tileCoordsWeWantToReach);

            if (!tileSafely.active() || tileSafely.type != 314)
            {
                return(false);
            }
            if (!tileSafely2.active() || tileSafely2.type != 314)
            {
                return(false);
            }
            GetExpectedDirections(tileCoordsOfFrontWheel, tileCoordsWeWantToReach, out var expectedStartLeft, out var expectedStartRight, out var expectedEndLeft, out var expectedEndRight);
            if (!Minecart.GetAreExpectationsForSidesMet(tileCoordsOfFrontWheel, expectedStartLeft, expectedStartRight))
            {
                return(false);
            }
            if (!Minecart.GetAreExpectationsForSidesMet(tileCoordsWeWantToReach, expectedEndLeft, expectedEndRight))
            {
                return(false);
            }
            return(true);
        }