Package mindustry.core
Class World
java.lang.Object
mindustry.core.World
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
World context that applies filters after generation end. -
Field Summary
Modifier and TypeFieldDescriptionfinal mindustry.core.World.Context
int
The number of times tiles have changed in this session. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDarkness
(Tiles tiles) void
addMapLoader
(Map map, Runnable loader) Adds a custom handler function for loading a custom map - usually a generated one.void
Call to signify the beginning of map loading.mindustry.gen.Building
build
(int pos) mindustry.gen.Building
build
(int x, int y) mindustry.gen.Building
buildWorld
(float x, float y) void
void
static float
conv
(float coord) Convert from world to logic tile coordinates.void
Call to signify the end of map loading.mindustry.core.World.Context
filterContext
(Map map) floor
(int x, int y) floorWorld
(float x, float y) float
getDarkness
(int x, int y) getQuadBounds
(Rect in) byte
getWallDarkness
(Tile tile) int
height()
boolean
isAccessible
(int x, int y) boolean
boolean
void
loadGenerator
(int width, int height, Cons<Tiles> generator) void
void
void
loadSector
(Sector sector) void
loadSector
(Sector sector, int seedOffset, boolean saveInfo) int
packArray
(int x, int y) boolean
passable
(int x, int y) rawTile
(int x, int y) static boolean
raycast
(int x1, int y1, int x2, int y2, Geometry.Raycaster cons) static void
raycastEach
(int x1, int y1, int x2, int y2, Geometry.Raycaster cons) static void
raycastEachWorld
(float x0, float y0, float x1, float y1, Geometry.Raycaster cons) resize
(int width, int height) Resizes the tile array to the specified size and returns the resulting tile array.void
setGenerating
(boolean gen) boolean
solid
(int x, int y) tile
(int pos) tile
(int x, int y) tileBuilding
(int x, int y) tileWorld
(float x, float y) static int
toTile
(float coord) static float
unconv
(float coord) Convert from tile to world coordinates.int
int
boolean
wallSolid
(int x, int y) boolean
wallSolidFull
(int x, int y) int
width()
-
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
-
build
-
rawTile
-
tileWorld
-
buildWorld
-
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
-
setGenerating
public void setGenerating(boolean gen) -
isGenerating
public boolean isGenerating() -
loadGenerator
-
loadSector
-
loadSector
-
filterContext
-
loadMap
-
loadMap
-
addDarkness
-
getWallDarkness
-
checkMapArea
public void checkMapArea() -
getDarkness
public float getDarkness(int x, int y) -
raycastEachWorld
public static void raycastEachWorld(float x0, float y0, float x1, float y1, Geometry.Raycaster cons) -
raycastEach
-
raycast
-