public static void UpdateRockTile(Cube cube) { if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)))) cube.TileType = GetRandomStoneRockQube(); if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)))) cube.TileType = GetRandomStoneRockTopQube(); if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)))) cube.TileType = GetRandomStoneRockBottomQube(); if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)) == false)) cube.TileType = GetRandomStoneRockLeftQube(); if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)))) cube.TileType = GetRandomStoneRockRightQube(); if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)) == false)) cube.TileType = TileType.StoneRockTopLeft; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)))) cube.TileType = TileType.StoneRockTopRight; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)) == false)) cube.TileType = TileType.StoneRockBottomLeft; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)))) cube.TileType = TileType.StoneRockBottomRight; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)) == false)) cube.TileType = TileType.StoneRockCorner2; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)))) cube.TileType = TileType.StoneRockCorner3; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)) == false)) cube.TileType = TileType.StoneRockCorner0; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)) == false)) cube.TileType = TileType.StoneRockCorner1; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)) == false)) cube.TileType = TileType.StoneRockNone; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)) == false)) cube.TileType = TileType.StoneRockLeftRight; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube))) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5) == null || WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 5).GetType().IsSubclassOf(typeof(Cube)) == false) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5) != null && WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 5).GetType().IsSubclassOf(typeof(Cube)))) cube.TileType = TileType.StoneRockTopBottom; }
public static void UpdateGrassTile(Cube cube) { if (WorldMap.Instance.GetMapElement(cube.Position.X , cube.Position.Y , 7) == null) return; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 7) != null && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 7) == null) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 7) != null && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 7) != null)))) cube.TileType = TileType.DirtBottom; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 7) != null && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 7) != null && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 7) == null) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 7) != null)))) cube.TileType = TileType.DirtTop; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 7) != null && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 7) != null && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 7) == null) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 7) == null )))) cube.TileType = TileType.DirtTopLeft; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 7) == null && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 7) != null && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 7) == null) && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 7) != null )))) cube.TileType = TileType.DirtTopRight; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 7) == null && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 7) == null) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 7) != null && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 7) != null)))) cube.TileType = TileType.DirtBottomLeft; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 7) != null && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 7) == null) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 7) != null && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 7) == null)))) cube.TileType = TileType.DirtBottomRight; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 7) != null && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 7) != null) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 7) != null && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 7) != null)))) cube.TileType = TileType.DirtAll; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 7) == null && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 7) != null) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 7) != null && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 7) != null)))) cube.TileType = TileType.DirtRight; if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 7) != null && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 7) != null) && (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 7) != null && (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 7) == null)))) cube.TileType = TileType.DirtLeft; // if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 7) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 7).GetType().IsAssignableFrom(typeof(DirtCube)) == true) && //(WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 7) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 7).GetType().IsAssignableFrom(typeof(DirtCube)) == true) && //(WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 7) != null && WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 7).GetType().IsAssignableFrom(typeof(DirtCube)) == true) && //(WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 7) != null && WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 7).GetType().IsAssignableFrom(typeof(DirtCube)) == true)) // cube.TileType = TileType.DirtBottom; }