Sector preset class / New missions
This commit is contained in:
@@ -27,7 +27,7 @@ allprojects {
|
|||||||
appName = 'Mindustry'
|
appName = 'Mindustry'
|
||||||
gdxVersion = '1.9.8'
|
gdxVersion = '1.9.8'
|
||||||
roboVMVersion = '2.3.0'
|
roboVMVersion = '2.3.0'
|
||||||
uCoreVersion = '33847672a0ea5c215f9799c5a010d60aade3101c'
|
uCoreVersion = 'e0789c76198a90cb115e12f03d44ddec35b35a6e'
|
||||||
|
|
||||||
getVersionString = {
|
getVersionString = {
|
||||||
String buildVersion = getBuildVersion()
|
String buildVersion = getBuildVersion()
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ text.sector.deploy=Deploy
|
|||||||
text.sector.resume=Resume
|
text.sector.resume=Resume
|
||||||
text.sector.locked=[scarlet][[Incomplete]
|
text.sector.locked=[scarlet][[Incomplete]
|
||||||
text.sector.unexplored=[accent][[Unexplored]
|
text.sector.unexplored=[accent][[Unexplored]
|
||||||
|
|
||||||
text.mission=Mission:[LIGHT_GRAY] {0}
|
text.mission=Mission:[LIGHT_GRAY] {0}
|
||||||
text.mission.info=Mission Info
|
text.mission.info=Mission Info
|
||||||
text.mission.complete=Mission complete!
|
text.mission.complete=Mission complete!
|
||||||
@@ -70,8 +71,11 @@ text.mission.resource.menu=Obtain {0} x{1}
|
|||||||
text.mission.resource=Obtain {0}:\n[accent]{1}/{2}[]
|
text.mission.resource=Obtain {0}:\n[accent]{1}/{2}[]
|
||||||
text.mission.block=Create {0}
|
text.mission.block=Create {0}
|
||||||
text.mission.unit=Create {0} Unit
|
text.mission.unit=Create {0} Unit
|
||||||
|
text.mission.command=Send Command {0} To Units
|
||||||
text.mission.linknode=Link Power Node
|
text.mission.linknode=Link Power Node
|
||||||
text.mission.display=[accent]Mission:\n[LIGHT_GRAY]{0}
|
text.mission.display=[accent]Mission:\n[LIGHT_GRAY]{0}
|
||||||
|
text.mission.mech=Switch to mech
|
||||||
|
|
||||||
text.none=<none>
|
text.none=<none>
|
||||||
text.close=Close
|
text.close=Close
|
||||||
text.quit=Quit
|
text.quit=Quit
|
||||||
@@ -381,6 +385,10 @@ category.general.name=General
|
|||||||
category.view.name=View
|
category.view.name=View
|
||||||
category.multiplayer.name=Multiplayer
|
category.multiplayer.name=Multiplayer
|
||||||
|
|
||||||
|
command.attack=Attack
|
||||||
|
command.retreat=Retreat
|
||||||
|
command.patrol=Patrol
|
||||||
|
|
||||||
keybind.press=Press a key...
|
keybind.press=Press a key...
|
||||||
keybind.press.axis=Press an axis or key...
|
keybind.press.axis=Press an axis or key...
|
||||||
keybind.move_x.name=Move x
|
keybind.move_x.name=Move x
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import io.anuke.mindustry.game.Team;
|
|||||||
import io.anuke.mindustry.game.Waves;
|
import io.anuke.mindustry.game.Waves;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Events;
|
import io.anuke.ucore.core.Events;
|
||||||
|
import io.anuke.ucore.util.Structs;
|
||||||
import io.anuke.ucore.util.GridBits;
|
import io.anuke.ucore.util.GridBits;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
@@ -184,7 +185,7 @@ public class WaveSpawner{
|
|||||||
quadrants = new GridBits(quadWidth(), quadHeight());
|
quadrants = new GridBits(quadWidth(), quadHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Mathf.inBounds(quadx, quady, quadWidth(), quadHeight())){
|
if(!Structs.inBounds(quadx, quady, quadWidth(), quadHeight())){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class Recipes implements ContentList{
|
|||||||
new Recipe(distribution, DistributionBlocks.distributor, new ItemStack(Items.densealloy, 8), new ItemStack(Items.copper, 8));
|
new Recipe(distribution, DistributionBlocks.distributor, new ItemStack(Items.densealloy, 8), new ItemStack(Items.copper, 8));
|
||||||
new Recipe(distribution, DistributionBlocks.sorter, new ItemStack(Items.densealloy, 4), new ItemStack(Items.copper, 4));
|
new Recipe(distribution, DistributionBlocks.sorter, new ItemStack(Items.densealloy, 4), new ItemStack(Items.copper, 4));
|
||||||
new Recipe(distribution, DistributionBlocks.overflowGate, new ItemStack(Items.densealloy, 4), new ItemStack(Items.copper, 8));
|
new Recipe(distribution, DistributionBlocks.overflowGate, new ItemStack(Items.densealloy, 4), new ItemStack(Items.copper, 8));
|
||||||
new Recipe(distribution, DistributionBlocks.bridgeConveyor, new ItemStack(Items.densealloy, 8), new ItemStack(Items.copper, 8));
|
new Recipe(distribution, DistributionBlocks.itemBridge, new ItemStack(Items.densealloy, 8), new ItemStack(Items.copper, 8));
|
||||||
new Recipe(distribution, DistributionBlocks.massDriver, new ItemStack(Items.densealloy, 400), new ItemStack(Items.silicon, 300), new ItemStack(Items.lead, 400), new ItemStack(Items.thorium, 250));
|
new Recipe(distribution, DistributionBlocks.massDriver, new ItemStack(Items.densealloy, 400), new ItemStack(Items.silicon, 300), new ItemStack(Items.lead, 400), new ItemStack(Items.thorium, 250));
|
||||||
|
|
||||||
//CRAFTING
|
//CRAFTING
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import io.anuke.mindustry.world.blocks.distribution.*;
|
|||||||
|
|
||||||
public class DistributionBlocks extends BlockList implements ContentList{
|
public class DistributionBlocks extends BlockList implements ContentList{
|
||||||
public static Block conveyor, titaniumconveyor, distributor, junction,
|
public static Block conveyor, titaniumconveyor, distributor, junction,
|
||||||
bridgeConveyor, phaseConveyor, sorter, router, overflowGate, massDriver;
|
itemBridge, phaseConveyor, sorter, router, overflowGate, massDriver;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
@@ -26,7 +26,7 @@ public class DistributionBlocks extends BlockList implements ContentList{
|
|||||||
capacity = 32;
|
capacity = 32;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
bridgeConveyor = new BufferedItemBridge("bridge-conveyor"){{
|
itemBridge = new BufferedItemBridge("bridge-conveyor"){{
|
||||||
range = 4;
|
range = 4;
|
||||||
speed = 60f;
|
speed = 60f;
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import io.anuke.ucore.entities.trait.Entity;
|
|||||||
import io.anuke.ucore.io.ByteBufferOutput;
|
import io.anuke.ucore.io.ByteBufferOutput;
|
||||||
import io.anuke.ucore.io.CountableByteArrayOutputStream;
|
import io.anuke.ucore.io.CountableByteArrayOutputStream;
|
||||||
import io.anuke.ucore.modules.Module;
|
import io.anuke.ucore.modules.Module;
|
||||||
|
import io.anuke.ucore.util.Structs;
|
||||||
import io.anuke.ucore.util.Log;
|
import io.anuke.ucore.util.Log;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
@@ -188,7 +189,7 @@ public class NetServer extends Module{
|
|||||||
|
|
||||||
if(state.mode.isPvp){
|
if(state.mode.isPvp){
|
||||||
//find team with minimum amount of players and auto-assign player to that.
|
//find team with minimum amount of players and auto-assign player to that.
|
||||||
Team min = Mathf.findMin(Team.all, team -> {
|
Team min = Structs.findMin(Team.all, team -> {
|
||||||
if(state.teams.isActive(team)){
|
if(state.teams.isActive(team)){
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for(Player other : playerGroup.all()){
|
for(Player other : playerGroup.all()){
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import io.anuke.ucore.scene.ui.TextField.TextFieldFilter;
|
|||||||
import io.anuke.ucore.scene.ui.TooltipManager;
|
import io.anuke.ucore.scene.ui.TooltipManager;
|
||||||
import io.anuke.ucore.scene.ui.layout.Table;
|
import io.anuke.ucore.scene.ui.layout.Table;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Structs;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ public class UI extends SceneModule{
|
|||||||
@Override
|
@Override
|
||||||
protected void loadSkin(){
|
protected void loadSkin(){
|
||||||
skin = new Skin(Gdx.files.internal("ui/uiskin.json"), Core.atlas);
|
skin = new Skin(Gdx.files.internal("ui/uiskin.json"), Core.atlas);
|
||||||
Mathf.each(font -> {
|
Structs.each(font -> {
|
||||||
font.setUseIntegerPositions(false);
|
font.setUseIntegerPositions(false);
|
||||||
font.getData().setScale(Vars.fontScale);
|
font.getData().setScale(Vars.fontScale);
|
||||||
font.getData().down += Unit.dp.scl(4f);
|
font.getData().down += Unit.dp.scl(4f);
|
||||||
|
|||||||
@@ -20,10 +20,7 @@ import io.anuke.ucore.core.Events;
|
|||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.entities.EntityQuery;
|
import io.anuke.ucore.entities.EntityQuery;
|
||||||
import io.anuke.ucore.modules.Module;
|
import io.anuke.ucore.modules.Module;
|
||||||
import io.anuke.ucore.util.Log;
|
import io.anuke.ucore.util.*;
|
||||||
import io.anuke.ucore.util.Mathf;
|
|
||||||
import io.anuke.ucore.util.ThreadArray;
|
|
||||||
import io.anuke.ucore.util.Tmp;
|
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -140,7 +137,7 @@ public class World extends Module{
|
|||||||
if(tiles == null){
|
if(tiles == null){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if(!Mathf.inBounds(x, y, tiles)) return null;
|
if(!Structs.inBounds(x, y, tiles)) return null;
|
||||||
return tiles[x][y];
|
return tiles[x][y];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,7 +232,7 @@ public class World extends Module{
|
|||||||
/**Loads up a sector map. This does not call play(), but calls reset().*/
|
/**Loads up a sector map. This does not call play(), but calls reset().*/
|
||||||
public void loadSector(Sector sector){
|
public void loadSector(Sector sector){
|
||||||
currentSector = sector;
|
currentSector = sector;
|
||||||
state.mode = sector.missions.peek().getMode();
|
state.mode = sector.mode;
|
||||||
state.difficulty = sectors.getDifficulty(sector);
|
state.difficulty = sectors.getDifficulty(sector);
|
||||||
Timers.mark();
|
Timers.mark();
|
||||||
Timers.mark();
|
Timers.mark();
|
||||||
@@ -337,7 +334,7 @@ public class World extends Module{
|
|||||||
public int transform(int packed, int oldWidth, int oldHeight, int newWidth, int shiftX, int shiftY){
|
public int transform(int packed, int oldWidth, int oldHeight, int newWidth, int shiftX, int shiftY){
|
||||||
int x = packed % oldWidth;
|
int x = packed % oldWidth;
|
||||||
int y = packed / oldWidth;
|
int y = packed / oldWidth;
|
||||||
if(!Mathf.inBounds(x, y, oldWidth, oldHeight)) return -1;
|
if(!Structs.inBounds(x, y, oldWidth, oldHeight)) return -1;
|
||||||
x += shiftX;
|
x += shiftX;
|
||||||
y += shiftY;
|
y += shiftY;
|
||||||
return y*newWidth + x;
|
return y*newWidth + x;
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import io.anuke.mindustry.maps.MapTileData.TileDataMarker;
|
|||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.blocks.Floor;
|
import io.anuke.mindustry.world.blocks.Floor;
|
||||||
import io.anuke.ucore.function.IntPositionConsumer;
|
import io.anuke.ucore.function.IntPositionConsumer;
|
||||||
|
import io.anuke.ucore.util.Structs;
|
||||||
import io.anuke.ucore.util.Bits;
|
import io.anuke.ucore.util.Bits;
|
||||||
import io.anuke.ucore.util.Mathf;
|
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.content;
|
import static io.anuke.mindustry.Vars.content;
|
||||||
import static io.anuke.mindustry.Vars.ui;
|
import static io.anuke.mindustry.Vars.ui;
|
||||||
@@ -83,7 +83,7 @@ public enum EditorTool{
|
|||||||
MapTileData data;
|
MapTileData data;
|
||||||
|
|
||||||
public void touched(MapEditor editor, int x, int y){
|
public void touched(MapEditor editor, int x, int y){
|
||||||
if(!Mathf.inBounds(x, y, editor.getMap().width(), editor.getMap().height())) return;
|
if(!Structs.inBounds(x, y, editor.getMap().width(), editor.getMap().height())) return;
|
||||||
|
|
||||||
if(editor.getDrawBlock().isMultiblock()){
|
if(editor.getDrawBlock().isMultiblock()){
|
||||||
//don't fill multiblocks, thanks
|
//don't fill multiblocks, thanks
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import io.anuke.mindustry.maps.MapTileData.DataPosition;
|
|||||||
import io.anuke.mindustry.maps.MapTileData.TileDataMarker;
|
import io.anuke.mindustry.maps.MapTileData.TileDataMarker;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.blocks.Floor;
|
import io.anuke.mindustry.world.blocks.Floor;
|
||||||
|
import io.anuke.ucore.util.Structs;
|
||||||
import io.anuke.ucore.util.Bits;
|
import io.anuke.ucore.util.Bits;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
import static io.anuke.mindustry.Vars.content;
|
import static io.anuke.mindustry.Vars.content;
|
||||||
@@ -124,7 +125,7 @@ public class MapEditor{
|
|||||||
int worldx = dx + offsetx + x;
|
int worldx = dx + offsetx + x;
|
||||||
int worldy = dy + offsety + y;
|
int worldy = dy + offsety + y;
|
||||||
|
|
||||||
if(Mathf.inBounds(worldx, worldy, map.width(), map.height())){
|
if(Structs.inBounds(worldx, worldy, map.width(), map.height())){
|
||||||
TileDataMarker prev = getPrev(worldx, worldy, false);
|
TileDataMarker prev = getPrev(worldx, worldy, false);
|
||||||
|
|
||||||
if(i == 1){
|
if(i == 1){
|
||||||
@@ -226,7 +227,7 @@ public class MapEditor{
|
|||||||
for(int dx = 0; dx < block.size; dx++){
|
for(int dx = 0; dx < block.size; dx++){
|
||||||
for(int dy = 0; dy < block.size; dy++){
|
for(int dy = 0; dy < block.size; dy++){
|
||||||
int worldx = x + dx + offsetx, worldy = y + dy + offsety;
|
int worldx = x + dx + offsetx, worldy = y + dy + offsety;
|
||||||
if(Mathf.inBounds(worldx, worldy, map.width(), map.height())){
|
if(Structs.inBounds(worldx, worldy, map.width(), map.height())){
|
||||||
TileDataMarker prev = getPrev(worldx, worldy, false);
|
TileDataMarker prev = getPrev(worldx, worldy, false);
|
||||||
|
|
||||||
map.write(worldx, worldy, DataPosition.link, (byte) 0);
|
map.write(worldx, worldy, DataPosition.link, (byte) 0);
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ import io.anuke.ucore.core.Core;
|
|||||||
import io.anuke.ucore.core.Graphics;
|
import io.anuke.ucore.core.Graphics;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.graphics.IndexedRenderer;
|
import io.anuke.ucore.graphics.IndexedRenderer;
|
||||||
|
import io.anuke.ucore.util.Structs;
|
||||||
import io.anuke.ucore.util.Bits;
|
import io.anuke.ucore.util.Bits;
|
||||||
import io.anuke.ucore.util.Geometry;
|
import io.anuke.ucore.util.Geometry;
|
||||||
import io.anuke.ucore.util.Mathf;
|
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.content;
|
import static io.anuke.mindustry.Vars.content;
|
||||||
import static io.anuke.mindustry.Vars.tilesize;
|
import static io.anuke.mindustry.Vars.tilesize;
|
||||||
@@ -156,7 +156,7 @@ public class MapRenderer implements Disposable{
|
|||||||
private boolean checkElevation(byte elev, int x, int y){
|
private boolean checkElevation(byte elev, int x, int y){
|
||||||
for(GridPoint2 p : Geometry.d4){
|
for(GridPoint2 p : Geometry.d4){
|
||||||
int wx = x + p.x, wy = y + p.y;
|
int wx = x + p.x, wy = y + p.y;
|
||||||
if(!Mathf.inBounds(wx, wy, editor.getMap().width(), editor.getMap().height())){
|
if(!Structs.inBounds(wx, wy, editor.getMap().width(), editor.getMap().height())){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
byte value = editor.getMap().read(wx, wy, DataPosition.elevation);
|
byte value = editor.getMap().read(wx, wy, DataPosition.elevation);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import io.anuke.ucore.core.Effects;
|
|||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.entities.EntityGroup;
|
import io.anuke.ucore.entities.EntityGroup;
|
||||||
import io.anuke.ucore.entities.impl.TimedEntity;
|
import io.anuke.ucore.entities.impl.TimedEntity;
|
||||||
|
import io.anuke.ucore.util.Structs;
|
||||||
import io.anuke.ucore.util.Geometry;
|
import io.anuke.ucore.util.Geometry;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
import io.anuke.ucore.util.Pooling;
|
import io.anuke.ucore.util.Pooling;
|
||||||
@@ -69,7 +70,7 @@ public class Fire extends TimedEntity implements SaveTrait, SyncTrait, Poolable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean has(int x, int y){
|
public static boolean has(int x, int y){
|
||||||
return Mathf.inBounds(x, y, world.width(), world.height()) && map.containsKey(x + y * world.width());
|
return Structs.inBounds(x, y, world.width(), world.height()) && map.containsKey(x + y * world.width());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
package io.anuke.mindustry.entities.units;
|
package io.anuke.mindustry.entities.units;
|
||||||
|
|
||||||
|
import io.anuke.ucore.util.Bundles;
|
||||||
|
|
||||||
public enum UnitCommand{
|
public enum UnitCommand{
|
||||||
attack, retreat, patrol
|
attack, retreat, patrol;
|
||||||
|
|
||||||
|
private final String localized;
|
||||||
|
|
||||||
|
UnitCommand(){
|
||||||
|
localized = Bundles.get("command." + name());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String localized(){
|
||||||
|
return localized;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,10 +29,7 @@ import io.anuke.ucore.core.Timers;
|
|||||||
import io.anuke.ucore.entities.EntityGroup;
|
import io.anuke.ucore.entities.EntityGroup;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.graphics.Shapes;
|
import io.anuke.ucore.graphics.Shapes;
|
||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.*;
|
||||||
import io.anuke.ucore.util.Geometry;
|
|
||||||
import io.anuke.ucore.util.Mathf;
|
|
||||||
import io.anuke.ucore.util.ThreadQueue;
|
|
||||||
|
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
@@ -373,7 +370,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{
|
|||||||
if(entity == null){
|
if(entity == null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
targetItem = Mathf.findMin(type.toMine, (a, b) -> -Integer.compare(entity.items.get(a), entity.items.get(b)));
|
targetItem = Structs.findMin(type.toMine, (a, b) -> -Integer.compare(entity.items.get(a), entity.items.get(b)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import io.anuke.ucore.core.Timers;
|
|||||||
import io.anuke.ucore.graphics.CacheBatch;
|
import io.anuke.ucore.graphics.CacheBatch;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.graphics.Fill;
|
import io.anuke.ucore.graphics.Fill;
|
||||||
|
import io.anuke.ucore.util.Structs;
|
||||||
import io.anuke.ucore.util.Geometry;
|
import io.anuke.ucore.util.Geometry;
|
||||||
import io.anuke.ucore.util.Log;
|
import io.anuke.ucore.util.Log;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
@@ -89,7 +90,7 @@ public class FloorRenderer{
|
|||||||
int worldx = camx + x;
|
int worldx = camx + x;
|
||||||
int worldy = camy + y;
|
int worldy = camy + y;
|
||||||
|
|
||||||
if(!Mathf.inBounds(worldx, worldy, cache))
|
if(!Structs.inBounds(worldx, worldy, cache))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Chunk chunk = cache[worldx][worldy];
|
Chunk chunk = cache[worldx][worldy];
|
||||||
@@ -159,7 +160,7 @@ public class FloorRenderer{
|
|||||||
int worldx = Mathf.scl(camera.position.x, chunksize * tilesize) + x;
|
int worldx = Mathf.scl(camera.position.x, chunksize * tilesize) + x;
|
||||||
int worldy = Mathf.scl(camera.position.y, chunksize * tilesize) + y;
|
int worldy = Mathf.scl(camera.position.y, chunksize * tilesize) + y;
|
||||||
|
|
||||||
if(!Mathf.inBounds(worldx, worldy, cache)){
|
if(!Structs.inBounds(worldx, worldy, cache)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,17 @@ import com.badlogic.gdx.graphics.Pixmap.Format;
|
|||||||
import com.badlogic.gdx.graphics.Texture;
|
import com.badlogic.gdx.graphics.Texture;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import io.anuke.mindustry.content.Items;
|
import io.anuke.mindustry.content.Items;
|
||||||
|
import io.anuke.mindustry.content.Mechs;
|
||||||
|
import io.anuke.mindustry.content.blocks.UnitBlocks;
|
||||||
|
import io.anuke.mindustry.content.blocks.UpgradeBlocks;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.entities.units.BaseUnit;
|
import io.anuke.mindustry.entities.units.BaseUnit;
|
||||||
|
import io.anuke.mindustry.entities.units.UnitCommand;
|
||||||
import io.anuke.mindustry.game.Difficulty;
|
import io.anuke.mindustry.game.Difficulty;
|
||||||
import io.anuke.mindustry.game.Team;
|
import io.anuke.mindustry.game.Team;
|
||||||
import io.anuke.mindustry.io.SaveIO;
|
import io.anuke.mindustry.io.SaveIO;
|
||||||
import io.anuke.mindustry.maps.generation.WorldGenerator.GenResult;
|
import io.anuke.mindustry.maps.generation.WorldGenerator.GenResult;
|
||||||
import io.anuke.mindustry.maps.missions.Mission;
|
import io.anuke.mindustry.maps.missions.*;
|
||||||
import io.anuke.mindustry.maps.missions.WaveMission;
|
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
import io.anuke.mindustry.type.ItemStack;
|
||||||
import io.anuke.mindustry.world.ColorMapper;
|
import io.anuke.mindustry.world.ColorMapper;
|
||||||
@@ -21,10 +24,7 @@ import io.anuke.ucore.core.Settings;
|
|||||||
import io.anuke.ucore.entities.Entities;
|
import io.anuke.ucore.entities.Entities;
|
||||||
import io.anuke.ucore.entities.EntityGroup;
|
import io.anuke.ucore.entities.EntityGroup;
|
||||||
import io.anuke.ucore.entities.trait.Entity;
|
import io.anuke.ucore.entities.trait.Entity;
|
||||||
import io.anuke.ucore.util.Bits;
|
import io.anuke.ucore.util.*;
|
||||||
import io.anuke.ucore.util.GridMap;
|
|
||||||
import io.anuke.ucore.util.Log;
|
|
||||||
import io.anuke.ucore.util.Mathf;
|
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -34,17 +34,22 @@ public class Sectors{
|
|||||||
|
|
||||||
private final GridMap<Sector> grid = new GridMap<>();
|
private final GridMap<Sector> grid = new GridMap<>();
|
||||||
|
|
||||||
private final GridMap<Array<Mission>> presets = new GridMap<Array<Mission>>(){{
|
private final GridMap<SectorPreset> presets = new GridMap<SectorPreset>(){{
|
||||||
put(0, 0, TutorialSector.getMissions());
|
put(0, 0, new SectorPreset(TutorialSector.getMissions(), Array.with(Items.copper), 1));
|
||||||
|
|
||||||
//water mission
|
//water mission
|
||||||
put(-2, 0, Array.with());
|
put(-2, 0, new SectorPreset(Array.with(), Array.with(Items.copper), 1));
|
||||||
//command center mission
|
//command center mission
|
||||||
put(0, 1, Array.with());
|
//TODO generate enemy base
|
||||||
|
//TODO make 2x2
|
||||||
|
//TODO more gen info
|
||||||
|
put(0, 1, new SectorPreset(Structs.array(new BlockMission(UnitBlocks.daggerFactory), Missions.blockRecipe(UnitBlocks.commandCenter),
|
||||||
|
new CommandMission(UnitCommand.retreat), new CommandMission(UnitCommand.attack), new BattleMission()), Array.with(Items.copper), 1));
|
||||||
//reconstructor mission
|
//reconstructor mission
|
||||||
put(0, -1, Array.with());
|
put(0, -1, new SectorPreset(Structs.array(Missions.blockRecipe(mobile ? UpgradeBlocks.tridentPad : UpgradeBlocks.deltaPad),
|
||||||
|
new MechMission(Mechs.delta)), Array.with(Items.copper), 1));
|
||||||
//oil mission
|
//oil mission
|
||||||
put(1, 0, Array.with());
|
put(1, 0, new SectorPreset(Array.with(), Array.with(Items.copper), 1));
|
||||||
}};
|
}};
|
||||||
|
|
||||||
public void playSector(Sector sector){
|
public void playSector(Sector sector){
|
||||||
@@ -306,7 +311,8 @@ public class Sectors{
|
|||||||
sector.difficulty = (int)(Mathf.dst(sector.x, sector.y));
|
sector.difficulty = (int)(Mathf.dst(sector.x, sector.y));
|
||||||
|
|
||||||
if(presets.containsKey(sector.x, sector.y)){
|
if(presets.containsKey(sector.x, sector.y)){
|
||||||
sector.missions.addAll(presets.get(sector.x, sector.y));
|
SectorPreset p = presets.get(sector.x, sector.y);
|
||||||
|
sector.missions.addAll(p.missions);
|
||||||
}else{
|
}else{
|
||||||
genMissions(sector);
|
genMissions(sector);
|
||||||
}
|
}
|
||||||
@@ -363,4 +369,20 @@ public class Sectors{
|
|||||||
sector.texture = new Texture(pixmap);
|
sector.texture = new Texture(pixmap);
|
||||||
pixmap.dispose();
|
pixmap.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class SectorPreset{
|
||||||
|
private final Array<Mission> missions;
|
||||||
|
private final Array<Item> ores;
|
||||||
|
private final int size;
|
||||||
|
|
||||||
|
public SectorPreset(Array<Mission> missions, Array<Item> ores, int size){
|
||||||
|
this.missions = missions;
|
||||||
|
this.ores = ores;
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
void generate(Sector sector){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import io.anuke.mindustry.type.Item;
|
|||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.production.Drill;
|
import io.anuke.mindustry.world.blocks.production.Drill;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Structs;
|
||||||
import io.anuke.ucore.util.SeedRandom;
|
import io.anuke.ucore.util.SeedRandom;
|
||||||
|
|
||||||
public class Generation{
|
public class Generation{
|
||||||
@@ -24,7 +24,7 @@ public class Generation{
|
|||||||
}
|
}
|
||||||
|
|
||||||
Tile tile(int x, int y){
|
Tile tile(int x, int y){
|
||||||
if(!Mathf.inBounds(x, y, tiles)){
|
if(!Structs.inBounds(x, y, tiles)){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return tiles[x][y];
|
return tiles[x][y];
|
||||||
@@ -41,7 +41,7 @@ public class Generation{
|
|||||||
for(int dy = 0; dy < block.size; dy++){
|
for(int dy = 0; dy < block.size; dy++){
|
||||||
int worldx = dx + offsetx + x;
|
int worldx = dx + offsetx + x;
|
||||||
int worldy = dy + offsety + y;
|
int worldy = dy + offsety + y;
|
||||||
if(!Mathf.inBounds(worldx, worldy, tiles)){
|
if(!Structs.inBounds(worldx, worldy, tiles)){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ public class Generation{
|
|||||||
for(int dy = 0; dy < block.size; dy++){
|
for(int dy = 0; dy < block.size; dy++){
|
||||||
int worldx = dx + offsetx + x;
|
int worldx = dx + offsetx + x;
|
||||||
int worldy = dy + offsety + y;
|
int worldy = dy + offsety + y;
|
||||||
if(!Mathf.inBounds(worldx, worldy, tiles) || !tiles[worldx][worldy].block().alwaysReplace){
|
if(!Structs.inBounds(worldx, worldy, tiles) || !tiles[worldx][worldy].block().alwaysReplace){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ public class Generation{
|
|||||||
for(int dy = 0; dy < block.size; dy++){
|
for(int dy = 0; dy < block.size; dy++){
|
||||||
int worldx = dx + offsetx + x;
|
int worldx = dx + offsetx + x;
|
||||||
int worldy = dy + offsety + y;
|
int worldy = dy + offsety + y;
|
||||||
if(!(worldx == x && worldy == y) && Mathf.inBounds(worldx, worldy, tiles)){
|
if(!(worldx == x && worldy == y) && Structs.inBounds(worldx, worldy, tiles)){
|
||||||
Tile toplace = tiles[worldx][worldy];
|
Tile toplace = tiles[worldx][worldy];
|
||||||
if(toplace != null){
|
if(toplace != null){
|
||||||
toplace.setLinked((byte) (dx + offsetx), (byte) (dy + offsety));
|
toplace.setLinked((byte) (dx + offsetx), (byte) (dy + offsety));
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import io.anuke.mindustry.world.blocks.Floor;
|
|||||||
import io.anuke.mindustry.world.blocks.OreBlock;
|
import io.anuke.mindustry.world.blocks.OreBlock;
|
||||||
import io.anuke.ucore.noise.RidgedPerlin;
|
import io.anuke.ucore.noise.RidgedPerlin;
|
||||||
import io.anuke.ucore.noise.Simplex;
|
import io.anuke.ucore.noise.Simplex;
|
||||||
|
import io.anuke.ucore.util.Structs;
|
||||||
import io.anuke.ucore.util.Geometry;
|
import io.anuke.ucore.util.Geometry;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
import io.anuke.ucore.util.SeedRandom;
|
import io.anuke.ucore.util.SeedRandom;
|
||||||
@@ -42,7 +43,7 @@ public class WorldGenerator{
|
|||||||
private ObjectMap<Block, Block> decoration;
|
private ObjectMap<Block, Block> decoration;
|
||||||
|
|
||||||
public WorldGenerator(){
|
public WorldGenerator(){
|
||||||
decoration = Mathf.map(
|
decoration = Structs.map(
|
||||||
Blocks.grass, Blocks.shrub,
|
Blocks.grass, Blocks.shrub,
|
||||||
Blocks.stone, Blocks.rock,
|
Blocks.stone, Blocks.rock,
|
||||||
Blocks.ice, Blocks.icerock,
|
Blocks.ice, Blocks.icerock,
|
||||||
@@ -203,7 +204,7 @@ public class WorldGenerator{
|
|||||||
byte elevation = tile.getElevation();
|
byte elevation = tile.getElevation();
|
||||||
|
|
||||||
for(GridPoint2 point : Geometry.d4){
|
for(GridPoint2 point : Geometry.d4){
|
||||||
if(!Mathf.inBounds(x + point.x, y + point.y, width, height)) continue;
|
if(!Structs.inBounds(x + point.x, y + point.y, width, height)) continue;
|
||||||
if(tiles[x + point.x][y + point.y].getElevation() < elevation){
|
if(tiles[x + point.x][y + point.y].getElevation() < elevation){
|
||||||
|
|
||||||
if(sim2.octaveNoise2D(1, 1, 1.0 / 8, x, y) > 0.8){
|
if(sim2.octaveNoise2D(1, 1, 1.0 / 8, x, y) > 0.8){
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import io.anuke.mindustry.world.Tile;
|
|||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.function.Consumer;
|
import io.anuke.ucore.function.Consumer;
|
||||||
import io.anuke.ucore.function.Predicate;
|
import io.anuke.ucore.function.Predicate;
|
||||||
|
import io.anuke.ucore.util.Structs;
|
||||||
import io.anuke.ucore.util.Geometry;
|
import io.anuke.ucore.util.Geometry;
|
||||||
import io.anuke.ucore.util.Mathf;
|
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
public class AStarPathFinder extends TilePathfinder{
|
public class AStarPathFinder extends TilePathfinder{
|
||||||
@@ -194,7 +194,7 @@ public class AStarPathFinder extends TilePathfinder{
|
|||||||
if(obstacle(current)) return;
|
if(obstacle(current)) return;
|
||||||
for(GridPoint2 p : Geometry.d4){
|
for(GridPoint2 p : Geometry.d4){
|
||||||
int wx = current.x + p.x, wy = current.y + p.y;
|
int wx = current.x + p.x, wy = current.y + p.y;
|
||||||
Tile n = Mathf.inBounds(wx, wy, tiles) ? tiles[wx][wy] : null;
|
Tile n = Structs.inBounds(wx, wy, tiles) ? tiles[wx][wy] : null;
|
||||||
if(!obstacle(n)) cons.accept(n);
|
if(!obstacle(n)) cons.accept(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package io.anuke.mindustry.maps.generation.pathfinding;
|
|||||||
|
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Structs;
|
||||||
|
|
||||||
public abstract class TilePathfinder{
|
public abstract class TilePathfinder{
|
||||||
protected Tile[][] tiles;
|
protected Tile[][] tiles;
|
||||||
@@ -12,7 +12,7 @@ public abstract class TilePathfinder{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected boolean inBounds(int x, int y){
|
protected boolean inBounds(int x, int y){
|
||||||
return Mathf.inBounds(x, y, tiles);
|
return Structs.inBounds(x, y, tiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void search(Tile start, Tile end, Array<Tile> out);
|
public abstract void search(Tile start, Tile end, Array<Tile> out);
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package io.anuke.mindustry.maps.missions;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.Vars;
|
||||||
|
import io.anuke.mindustry.entities.units.BaseUnit;
|
||||||
|
import io.anuke.mindustry.entities.units.UnitCommand;
|
||||||
|
import io.anuke.ucore.util.Bundles;
|
||||||
|
|
||||||
|
public class CommandMission extends Mission{
|
||||||
|
private final UnitCommand command;
|
||||||
|
|
||||||
|
public CommandMission(UnitCommand command){
|
||||||
|
this.command = command;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isComplete(){
|
||||||
|
for(BaseUnit unit : Vars.unitGroups[Vars.defaultTeam.ordinal()].all()){
|
||||||
|
if(unit.isCommanded() && unit.getCommand() == command){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String displayString(){
|
||||||
|
return Bundles.format("text.mission.battle", command.localized());
|
||||||
|
}
|
||||||
|
}
|
||||||
22
core/src/io/anuke/mindustry/maps/missions/MechMission.java
Normal file
22
core/src/io/anuke/mindustry/maps/missions/MechMission.java
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
package io.anuke.mindustry.maps.missions;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.type.Mech;
|
||||||
|
import io.anuke.ucore.util.Bundles;
|
||||||
|
|
||||||
|
public class MechMission extends Mission{
|
||||||
|
private final Mech mech;
|
||||||
|
|
||||||
|
public MechMission(Mech mech){
|
||||||
|
this.mech = mech;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isComplete(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String displayString(){
|
||||||
|
return Bundles.format("te");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -30,7 +30,7 @@ public abstract class Mission{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public GameMode getMode(){
|
public GameMode getMode(){
|
||||||
return GameMode.noWaves;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**Sets the message displayed on mission begin. Returns this mission for chaining.*/
|
/**Sets the message displayed on mission begin. Returns this mission for chaining.*/
|
||||||
|
|||||||
22
core/src/io/anuke/mindustry/maps/missions/Missions.java
Normal file
22
core/src/io/anuke/mindustry/maps/missions/Missions.java
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
package io.anuke.mindustry.maps.missions;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
import io.anuke.mindustry.type.ItemStack;
|
||||||
|
import io.anuke.mindustry.type.Recipe;
|
||||||
|
import io.anuke.mindustry.world.Block;
|
||||||
|
|
||||||
|
public class Missions{
|
||||||
|
|
||||||
|
/**Returns an array of missions to obtain the items needed to make this block.
|
||||||
|
* This array includes a mission to place this block.*/
|
||||||
|
public static Array<Mission> blockRecipe(Block block){
|
||||||
|
Recipe recipe = Recipe.getByResult(block);
|
||||||
|
|
||||||
|
Array<Mission> out = new Array<>();
|
||||||
|
for(ItemStack stack : recipe.requirements){
|
||||||
|
out.add(new ItemMission(stack.item, stack.amount));
|
||||||
|
}
|
||||||
|
out.add(new BlockMission(block));
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,12 +15,13 @@ import io.anuke.ucore.core.Effects.Effect;
|
|||||||
import io.anuke.ucore.function.BiPredicate;
|
import io.anuke.ucore.function.BiPredicate;
|
||||||
import io.anuke.ucore.function.Predicate;
|
import io.anuke.ucore.function.Predicate;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
|
import io.anuke.ucore.util.Structs;
|
||||||
import io.anuke.ucore.util.Geometry;
|
import io.anuke.ucore.util.Geometry;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class Floor extends Block{
|
public class Floor extends Block{
|
||||||
//TODO implement proper bitmasking
|
//TODO implement proper bitmasking
|
||||||
protected static IntIntMap bitmask = Mathf.mapInt(2, 1, 8, 2, 10, 3, 11, 4, 16, 5, 18, 6, 22, 7, 24, 8,
|
protected static IntIntMap bitmask = Structs.mapInt(2, 1, 8, 2, 10, 3, 11, 4, 16, 5, 18, 6, 22, 7, 24, 8,
|
||||||
26, 9, 27, 10, 30, 11, 31, 12, 64, 13, 66, 14, 72, 15, 74, 16, 75, 17, 80, 18,
|
26, 9, 27, 10, 30, 11, 31, 12, 64, 13, 66, 14, 72, 15, 74, 16, 75, 17, 80, 18,
|
||||||
82, 19, 86, 20, 88, 21, 90, 22, 91, 23, 94, 24, 95, 25, 104, 26, 106, 27, 107, 28,
|
82, 19, 86, 20, 88, 21, 90, 22, 91, 23, 94, 24, 95, 25, 104, 26, 106, 27, 107, 28,
|
||||||
120, 29, 122, 30, 123, 31, 126, 32, 127, 33, 208, 34, 210, 35, 214, 36, 216, 37,
|
120, 29, 122, 30, 123, 31, 126, 32, 127, 33, 208, 34, 210, 35, 214, 36, 216, 37,
|
||||||
|
|||||||
@@ -155,21 +155,3 @@ task packrZip() {
|
|||||||
finalizedBy 'zip'
|
finalizedBy 'zip'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
eclipse {
|
|
||||||
project {
|
|
||||||
name = appName + "-desktop"
|
|
||||||
linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/core/assets'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task afterEclipseImport(description: "Post processing after project generation", group: "IDE") {
|
|
||||||
doLast {
|
|
||||||
def classpath = new XmlParser().parse(file(".classpath"))
|
|
||||||
new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ])
|
|
||||||
def writer = new FileWriter(file(".classpath"))
|
|
||||||
def printer = new XmlNodePrinter(new PrintWriter(writer))
|
|
||||||
printer.setPreserveWhitespace(true)
|
|
||||||
printer.print(classpath)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package io.anuke.mindustry;
|
|||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Structs;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
@@ -44,7 +44,7 @@ public class Image {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEmpty(int x, int y){
|
public boolean isEmpty(int x, int y){
|
||||||
if(!Mathf.inBounds(x, y, width(), height())){
|
if(!Structs.inBounds(x, y, width(), height())){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Color color = getColor(x, y);
|
Color color = getColor(x, y);
|
||||||
|
|||||||
Reference in New Issue
Block a user