Package mindustry.core
Class World
java.lang.Object
mindustry.core.World
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassWorld context that applies filters after generation end. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal mindustry.core.World.ContextintThe number of times tiles have changed in this session. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDarkness(Tiles tiles) voidaddMapLoader(Map map, Runnable loader) Adds a custom handler function for loading a custom map - usually a generated one.voidCall to signify the beginning of map loading.mindustry.gen.Buildingbuild(int pos) mindustry.gen.Buildingbuild(int x, int y) mindustry.gen.BuildingbuildWorld(float x, float y) voidcheckMapArea(int x, int y, int w, int h) voidstatic floatconv(float coord) Convert from world to logic tile coordinates.voidCall to signify the end of map loading.mindustry.core.World.ContextfilterContext(Map map) floor(int x, int y) floorWorld(float x, float y) floatgetDarkness(int x, int y) arc.math.geom.RectgetQuadBounds(arc.math.geom.Rect in) bytegetWallDarkness(Tile tile) intheight()booleanisAccessible(int x, int y) booleanbooleanvoidloadGenerator(int width, int height, arc.func.Cons<Tiles> generator) voidvoidvoidloadSector(Sector sector) voidloadSector(Sector sector, WorldParams params) makeSectorContext(Sector sector) intpackArray(int x, int y) booleanpassable(int x, int y) rawTile(int x, int y) static booleanraycast(int x1, int y1, int x2, int y2, arc.math.geom.Geometry.Raycaster cons) static voidraycastEach(int x1, int y1, int x2, int y2, arc.math.geom.Geometry.Raycaster cons) static voidraycastEachWorld(float x0, float y0, float x1, float y1, arc.math.geom.Geometry.Raycaster cons) resize(int width, int height) Resizes the tile array to the specified size and returns the resulting tile array.voidsetGenerating(boolean gen) booleansolid(int x, int y) tile(int pos) tile(int x, int y) tileBuilding(int x, int y) tileWorld(float x, float y) static inttoTile(float coord) static floatunconv(float coord) Convert from tile to world coordinates.intintbooleanwallSolid(int x, int y) booleanwallSolidFull(int x, int y) intwidth()
-
Field Details
-
context
public final mindustry.core.World.Context context -
tiles
-
tileChanges
public int tileChangesThe number of times tiles have changed in this session. Used for blocks that need to poll world state, but not frequently.
-
-
Constructor Details
-
World
public World()
-
-
Method Details
-
addMapLoader
Adds a custom handler function for loading a custom map - usually a generated one. -
isInvalidMap
public boolean isInvalidMap() -
solid
public boolean solid(int x, int y) -
passable
public boolean passable(int x, int y) -
wallSolid
public boolean wallSolid(int x, int y) -
wallSolidFull
public boolean wallSolidFull(int x, int y) -
isAccessible
public boolean isAccessible(int x, int y) -
width
public int width() -
height
public int height() -
unitWidth
public int unitWidth() -
unitHeight
public int unitHeight() -
floor
-
floorWorld
-
tile
-
tile
-
tileBuilding
-
build
@Nullable public mindustry.gen.Building build(int x, int y) -
build
@Nullable public mindustry.gen.Building build(int pos) -
rawTile
-
tileWorld
-
buildWorld
@Nullable public mindustry.gen.Building buildWorld(float x, float y) -
conv
public static float conv(float coord) Convert from world to logic tile coordinates. Whole numbers are at centers of tiles. -
unconv
public static float unconv(float coord) Convert from tile to world coordinates. -
toTile
public static int toTile(float coord) -
packArray
public int packArray(int x, int y) -
clearBuildings
public void clearBuildings() -
resize
Resizes the tile array to the specified size and returns the resulting tile array. Only use for loading saves! -
beginMapLoad
public void beginMapLoad()Call to signify the beginning of map loading. TileEvents will not be fired until endMapLoad(). -
endMapLoad
public void endMapLoad()Call to signify the end of map loading. Updates tile proximities and sets up physics for the world. A WorldLoadEvent will be fire. -
getQuadBounds
public arc.math.geom.Rect getQuadBounds(arc.math.geom.Rect in) -
setGenerating
public void setGenerating(boolean gen) -
isGenerating
public boolean isGenerating() -
loadGenerator
-
loadSector
-
loadSector
-
filterContext
-
loadMap
-
loadMap
-
addDarkness
-
getWallDarkness
-
checkMapArea
public void checkMapArea(int x, int y, int w, int h) -
getDarkness
public float getDarkness(int x, int y) -
raycastEachWorld
public static void raycastEachWorld(float x0, float y0, float x1, float y1, arc.math.geom.Geometry.Raycaster cons) -
raycastEach
public static void raycastEach(int x1, int y1, int x2, int y2, arc.math.geom.Geometry.Raycaster cons) -
raycast
public static boolean raycast(int x1, int y1, int x2, int y2, arc.math.geom.Geometry.Raycaster cons) -
makeSectorContext
-