Merge branch '6.0' into crater
# Conflicts: # core/assets/sprites/block_colors.png # core/assets/sprites/sprites.atlas # core/assets/sprites/sprites.png # core/assets/sprites/sprites2.png # core/assets/sprites/sprites4.png # core/assets/sprites/sprites6.png # core/src/mindustry/ui/fragments/PlayerListFragment.java
|
After Width: | Height: | Size: 926 B |
@@ -198,12 +198,12 @@ server.outdated = [crimson]伺服器版本過舊![]
|
|||||||
server.outdated.client = [crimson]客戶端版本過舊![]
|
server.outdated.client = [crimson]客戶端版本過舊![]
|
||||||
server.version = [gray]v{0} {1}
|
server.version = [gray]v{0} {1}
|
||||||
server.custombuild = [accent]自訂客戶端
|
server.custombuild = [accent]自訂客戶端
|
||||||
confirmban = 您確定要封禁該玩家嗎?
|
confirmban = 您確定要封禁「[white]{0}[]」嗎?
|
||||||
confirmkick = 您確定要踢出該玩家嗎?
|
confirmkick = 您確定要踢出「[white]{0}[]」嗎?
|
||||||
confirmvotekick = 您確定要投票剔除該名玩家嗎?
|
confirmvotekick = 您確定要投票剔除「[white]{0}[]」嗎?
|
||||||
confirmunban = 您確定要解除封禁該玩家嗎?
|
confirmunban = 您確定要解除封禁這個玩家嗎?
|
||||||
confirmadmin = 您確定要晉升這個玩家為管理員嗎?
|
confirmadmin = 您確定要晉升「[white]{0}[]」為管理員嗎?
|
||||||
confirmunadmin = 您確定要解除這個玩家的管理員嗎?
|
confirmunadmin = 您確定要解除「[white]{0}[]」的管理員嗎?
|
||||||
joingame.title = 加入遊戲
|
joingame.title = 加入遊戲
|
||||||
joingame.ip = IP位址:
|
joingame.ip = IP位址:
|
||||||
disconnect = 已中斷連線。
|
disconnect = 已中斷連線。
|
||||||
@@ -380,7 +380,7 @@ editor.unsaved = [scarlet]尚未儲存變更![]\n您確定要退出嗎?
|
|||||||
editor.resizemap = 調整地圖大小
|
editor.resizemap = 調整地圖大小
|
||||||
editor.mapname = 地圖名稱:
|
editor.mapname = 地圖名稱:
|
||||||
editor.overwrite = [accent]警告!這將會覆蓋現有的地圖。
|
editor.overwrite = [accent]警告!這將會覆蓋現有的地圖。
|
||||||
editor.overwrite.confirm = [scarlet]警告![]同名地圖存在,確定要覆蓋現有地圖?
|
editor.overwrite.confirm = [scarlet]警告![]同名地圖存在,確定要覆蓋現有地圖?\n「[accent]{0}[]」
|
||||||
editor.exists = 具有該名稱的地圖已經存在。
|
editor.exists = 具有該名稱的地圖已經存在。
|
||||||
editor.selectmap = 選取要載入的地圖:
|
editor.selectmap = 選取要載入的地圖:
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 711 B After Width: | Height: | Size: 711 B |
|
Before Width: | Height: | Size: 731 KiB After Width: | Height: | Size: 738 KiB |
|
Before Width: | Height: | Size: 818 KiB After Width: | Height: | Size: 821 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 127 KiB |
|
Before Width: | Height: | Size: 221 KiB After Width: | Height: | Size: 222 KiB |
@@ -75,7 +75,7 @@ abstract class BuilderComp implements Unitc, DrawLayerFlyingc{
|
|||||||
if(!current.initialized && !current.breaking && Build.validPlace(team(), current.x, current.y, current.block, current.rotation)){
|
if(!current.initialized && !current.breaking && Build.validPlace(team(), current.x, current.y, current.block, current.rotation)){
|
||||||
boolean hasAll = !Structs.contains(current.block.requirements, i -> !core.items().has(i.item));
|
boolean hasAll = !Structs.contains(current.block.requirements, i -> !core.items().has(i.item));
|
||||||
|
|
||||||
if(hasAll){
|
if(hasAll || state.rules.infiniteResources){
|
||||||
Build.beginPlace(team(), current.x, current.y, current.block, current.rotation);
|
Build.beginPlace(team(), current.x, current.y, current.block, current.rotation);
|
||||||
}else{
|
}else{
|
||||||
current.stuck = true;
|
current.stuck = true;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import mindustry.type.*;
|
|||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
import mindustry.world.blocks.environment.*;
|
import mindustry.world.blocks.environment.*;
|
||||||
|
import mindustry.world.blocks.payloads.*;
|
||||||
import mindustry.world.blocks.power.*;
|
import mindustry.world.blocks.power.*;
|
||||||
import mindustry.world.consumers.*;
|
import mindustry.world.consumers.*;
|
||||||
import mindustry.world.meta.*;
|
import mindustry.world.meta.*;
|
||||||
@@ -319,6 +320,40 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
|
|||||||
noSleep();
|
noSleep();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean acceptPayload(Tilec source, Payload payload){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void handlePayload(Tilec source, Payload payload){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tries dumping a payload.
|
||||||
|
* @param todump payload to dump.
|
||||||
|
* @return whether the payload was moved successfully
|
||||||
|
*/
|
||||||
|
public boolean dumpPayload(@NonNull Payload todump){
|
||||||
|
Array<Tilec> proximity = proximity();
|
||||||
|
int dump = rotation();
|
||||||
|
|
||||||
|
if(proximity.size == 0) return false;
|
||||||
|
|
||||||
|
for(int i = 0; i < proximity.size; i++){
|
||||||
|
Tilec other = proximity.get((i + dump) % proximity.size);
|
||||||
|
|
||||||
|
if(other.team() == team() && other.acceptPayload(this, todump)){
|
||||||
|
other.handlePayload(this, todump);
|
||||||
|
incrementDump(proximity.size);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
incrementDump(proximity.size);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public void handleItem(Tilec source, Item item){
|
public void handleItem(Tilec source, Item item){
|
||||||
items.add(item, 1);
|
items.add(item, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,17 +4,31 @@ import arc.*;
|
|||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
|
import arc.math.geom.*;
|
||||||
import arc.util.ArcAnnotate.*;
|
import arc.util.ArcAnnotate.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.*;
|
import mindustry.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
|
import mindustry.world.*;
|
||||||
|
|
||||||
import static mindustry.Vars.renderer;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class Drawf{
|
public class Drawf{
|
||||||
|
|
||||||
|
public static void selected(int x, int y, Block block, Color color){
|
||||||
|
Draw.color(color);
|
||||||
|
for(int i = 0; i < 4; i++){
|
||||||
|
Point2 p = Geometry.d8edge[i];
|
||||||
|
float offset = -Math.max(block.size - 1, 0) / 2f * tilesize;
|
||||||
|
Draw.rect("block-select",
|
||||||
|
x*tilesize + block.offset() + offset * p.x,
|
||||||
|
y*tilesize + block.offset() + offset * p.y, i * 90);
|
||||||
|
}
|
||||||
|
Draw.reset();
|
||||||
|
}
|
||||||
|
|
||||||
public static void shadow(float x, float y, float rad){
|
public static void shadow(float x, float y, float rad){
|
||||||
Draw.color(0, 0, 0, 0.4f);
|
Draw.color(0, 0, 0, 0.4f);
|
||||||
Draw.rect("circle-shadow", x, y, rad, rad);
|
Draw.rect("circle-shadow", x, y, rad, rad);
|
||||||
|
|||||||
@@ -229,15 +229,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void drawSelected(int x, int y, Block block, Color color){
|
public void drawSelected(int x, int y, Block block, Color color){
|
||||||
Draw.color(color);
|
Drawf.selected(x, y, block, color);
|
||||||
for(int i = 0; i < 4; i++){
|
|
||||||
Point2 p = Geometry.d8edge[i];
|
|
||||||
float offset = -Math.max(block.size - 1, 0) / 2f * tilesize;
|
|
||||||
Draw.rect("block-select",
|
|
||||||
x*tilesize + block.offset() + offset * p.x,
|
|
||||||
y*tilesize + block.offset() + offset * p.y, i * 90);
|
|
||||||
}
|
|
||||||
Draw.reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawBreaking(BuildRequest request){
|
public void drawBreaking(BuildRequest request){
|
||||||
|
|||||||
@@ -116,9 +116,9 @@ public class PlayerListFragment extends Fragment{
|
|||||||
t.defaults().size(bs);
|
t.defaults().size(bs);
|
||||||
|
|
||||||
t.addImageButton(Icon.hammer, Styles.clearPartiali,
|
t.addImageButton(Icon.hammer, Styles.clearPartiali,
|
||||||
() -> ui.showConfirm("$confirm", "$confirmban", () -> Call.onAdminRequest(user, AdminAction.ban)));
|
() -> ui.showConfirm("$confirm", Core.bundle.format("confirmban", user.name()), () -> Call.onAdminRequest(user, AdminAction.ban)));
|
||||||
t.addImageButton(Icon.cancel, Styles.clearPartiali,
|
t.addImageButton(Icon.cancel, Styles.clearPartiali,
|
||||||
() -> ui.showConfirm("$confirm", "$confirmkick", () -> Call.onAdminRequest(user, AdminAction.kick)));
|
() -> ui.showConfirm("$confirm", Core.bundle.format("confirmkick", user.name()), () -> Call.onAdminRequest(user, AdminAction.kick)));
|
||||||
|
|
||||||
t.row();
|
t.row();
|
||||||
|
|
||||||
@@ -128,9 +128,9 @@ public class PlayerListFragment extends Fragment{
|
|||||||
String id = user.uuid();
|
String id = user.uuid();
|
||||||
|
|
||||||
if(netServer.admins.isAdmin(id, connection.address)){
|
if(netServer.admins.isAdmin(id, connection.address)){
|
||||||
ui.showConfirm("$confirm", "$confirmunadmin", () -> netServer.admins.unAdminPlayer(id));
|
ui.showConfirm("$confirm", Core.bundle.format("confirmunadmin", user.name()), () -> netServer.admins.unAdminPlayer(id));
|
||||||
}else{
|
}else{
|
||||||
ui.showConfirm("$confirm", "$confirmadmin", () -> netServer.admins.adminPlayer(id, user.usid()));
|
ui.showConfirm("$confirm", Core.bundle.format("confirmadmin", user.name()), () -> netServer.admins.adminPlayer(id, user.usid()));
|
||||||
}
|
}
|
||||||
}).update(b -> b.setChecked(user.admin()))
|
}).update(b -> b.setChecked(user.admin()))
|
||||||
.disabled(b -> net.client())
|
.disabled(b -> net.client())
|
||||||
@@ -144,7 +144,7 @@ public class PlayerListFragment extends Fragment{
|
|||||||
button.add().growY();
|
button.add().growY();
|
||||||
|
|
||||||
button.addImageButton(Icon.hammer, Styles.clearPartiali,
|
button.addImageButton(Icon.hammer, Styles.clearPartiali,
|
||||||
() -> ui.showConfirm("$confirm", "$confirmvotekick", () -> Call.sendChatMessage("/votekick " + user.name()))).size(h);
|
() -> ui.showConfirm("$confirm", Core.bundle.format("confirmvotekick", user.name()), () -> Call.sendChatMessage("/votekick " + user.name()))).size(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
content.add(button).padBottom(-6).width(350f).maxHeight(h + 14);
|
content.add(button).padBottom(-6).width(350f).maxHeight(h + 14);
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ public class Block extends UnlockableContent{
|
|||||||
public boolean outputsLiquid = false;
|
public boolean outputsLiquid = false;
|
||||||
public boolean consumesPower = true;
|
public boolean consumesPower = true;
|
||||||
public boolean outputsPower = false;
|
public boolean outputsPower = false;
|
||||||
|
public boolean outputsPayload = false;
|
||||||
|
|
||||||
public int itemCapacity = 10;
|
public int itemCapacity = 10;
|
||||||
public float liquidCapacity = 10f;
|
public float liquidCapacity = 10f;
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import mindustry.content.*;
|
|||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.ui.*;
|
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
import mindustry.world.blocks.payloads.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -29,6 +29,7 @@ public class MassConveyor extends Block{
|
|||||||
size = 3;
|
size = 3;
|
||||||
rotate = true;
|
rotate = true;
|
||||||
update = true;
|
update = true;
|
||||||
|
outputsPayload = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -39,10 +40,27 @@ public class MassConveyor extends Block{
|
|||||||
edgeRegion = Core.atlas.find(name + "-edge");
|
edgeRegion = Core.atlas.find(name + "-edge");
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MassConveyorEntity extends TileEntity implements MassAcceptor{
|
@Override
|
||||||
|
protected TextureRegion[] generateIcons(){
|
||||||
|
return new TextureRegion[]{Core.atlas.find(name + "-icon")};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||||
|
super.drawPlace(x, y, rotation, valid);
|
||||||
|
|
||||||
|
for(int i = 0; i < 4; i++){
|
||||||
|
Tilec other = world.ent(x + Geometry.d4x[i] * size, y + Geometry.d4y[i] * size);
|
||||||
|
if(other != null && other.block().outputsPayload && other.block().size == size){
|
||||||
|
Drawf.selected(other.tileX(), other.tileY(), other.block(), Pal.accent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MassConveyorEntity extends TileEntity{
|
||||||
public @Nullable Payload item;
|
public @Nullable Payload item;
|
||||||
public float progress, itemRotation, animation;
|
public float progress, itemRotation, animation;
|
||||||
public @Nullable MassAcceptor next;
|
public @Nullable Tilec next;
|
||||||
public boolean blocked;
|
public boolean blocked;
|
||||||
public int step = -1, stepAccepted = -1;
|
public int step = -1, stepAccepted = -1;
|
||||||
|
|
||||||
@@ -52,9 +70,9 @@ public class MassConveyor extends Block{
|
|||||||
|
|
||||||
Tilec accept = nearby(Geometry.d4[rotation()].x * size, Geometry.d4[rotation()].y * size);
|
Tilec accept = nearby(Geometry.d4[rotation()].x * size, Geometry.d4[rotation()].y * size);
|
||||||
//next block must be aligned and of the same size
|
//next block must be aligned and of the same size
|
||||||
if(accept instanceof MassAcceptor && accept.block().size == size &&
|
if(accept != null && accept.block().size == size &&
|
||||||
tileX() + Geometry.d4[rotation()].x * size == accept.tileX() && tileY() + Geometry.d4[rotation()].y * size == accept.tileY()){
|
tileX() + Geometry.d4[rotation()].x * size == accept.tileX() && tileY() + Geometry.d4[rotation()].y * size == accept.tileY()){
|
||||||
next = (MassAcceptor)accept;
|
next = accept;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ntrns = 1 + size/2;
|
int ntrns = 1 + size/2;
|
||||||
@@ -73,6 +91,7 @@ public class MassConveyor extends Block{
|
|||||||
animation = 0f;
|
animation = 0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO nondeterministic input priority
|
||||||
int curStep = curStep();
|
int curStep = curStep();
|
||||||
if(curStep > step){
|
if(curStep > step){
|
||||||
boolean valid = step != -1;
|
boolean valid = step != -1;
|
||||||
@@ -83,21 +102,21 @@ public class MassConveyor extends Block{
|
|||||||
//trigger update forward
|
//trigger update forward
|
||||||
next.updateTile();
|
next.updateTile();
|
||||||
|
|
||||||
if(next.acceptMass(item, this)){
|
if(next.acceptPayload(this, item)){
|
||||||
//move forward.
|
//move forward.
|
||||||
next.handleMass(item, this);
|
next.handlePayload(this, item);
|
||||||
item = null;
|
item = null;
|
||||||
}
|
}
|
||||||
}else if(!blocked){
|
}else if(!blocked){
|
||||||
//dump item forward
|
//dump item forward
|
||||||
float trnext = size * tilesize / 2f, cx = Geometry.d4[rotation()].x, cy = Geometry.d4[rotation()].y, rot = rotation() * 90;
|
float trnext = size * tilesize / 2f, cx = Geometry.d4[rotation()].x, cy = Geometry.d4[rotation()].y, rot = rotation() * 90;
|
||||||
|
|
||||||
item.dump(x + cx * trnext, y + cy * trnext, rotation() * 90);
|
if(item.dump(x + cx * trnext, y + cy * trnext, rotation() * 90)){
|
||||||
item = null;
|
item = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -172,13 +191,13 @@ public class MassConveyor extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean acceptMass(Payload item, Tilec source){
|
public boolean acceptPayload(Tilec source, Payload payload){
|
||||||
return this.item == null;
|
return this.item == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleMass(Payload item, Tilec source){
|
public void handlePayload(Tilec source, Payload payload){
|
||||||
this.item = item;
|
this.item = payload;
|
||||||
this.stepAccepted = curStep();
|
this.stepAccepted = curStep();
|
||||||
this.itemRotation = source.rotation() * 90;
|
this.itemRotation = source.rotation() * 90;
|
||||||
this.animation = 0;
|
this.animation = 0;
|
||||||
@@ -189,8 +208,9 @@ public class MassConveyor extends Block{
|
|||||||
return !blocked || next != null;
|
return !blocked || next != null;
|
||||||
}else{
|
}else{
|
||||||
Tilec accept = nearby(Geometry.d4[direction].x * size, Geometry.d4[direction].y * size);
|
Tilec accept = nearby(Geometry.d4[direction].x * size, Geometry.d4[direction].y * size);
|
||||||
return accept instanceof MassAcceptor && accept.block().size == size &&
|
return accept != null && accept.block().size == size && accept.block().outputsPayload &&
|
||||||
accept.tileX() + Geometry.d4[accept.rotation()].x * size == tileX() && accept.tileY() + Geometry.d4[accept.rotation()].y * size == tileY();
|
//block must either be facing this one, or not be rotating
|
||||||
|
((accept.tileX() + Geometry.d4[accept.rotation()].x * size == tileX() && accept.tileY() + Geometry.d4[accept.rotation()].y * size == tileY()) || !accept.block().rotate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +239,7 @@ public class MassConveyor extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
int curStep(){
|
int curStep(){
|
||||||
return (int)(Time.time() / moveTime);
|
return (int)((Time.time()) / moveTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
float fract(){
|
float fract(){
|
||||||
@@ -227,36 +247,4 @@ public class MassConveyor extends Block{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface MassAcceptor extends Tilec{
|
|
||||||
boolean acceptMass(Payload item, Tilec source);
|
|
||||||
void handleMass(Payload item, Tilec source);
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface Payload{
|
|
||||||
void draw(float x, float y, float rotation);
|
|
||||||
void dump(float x, float y, float rotation);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class UnitPayload implements Payload{
|
|
||||||
public Unitc unit;
|
|
||||||
|
|
||||||
public UnitPayload(Unitc unit){
|
|
||||||
this.unit = unit;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void dump(float x, float y, float rotation){
|
|
||||||
unit.set(x, y);
|
|
||||||
unit.rotation(rotation);
|
|
||||||
unit.add();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void draw(float x, float y, float rotation){
|
|
||||||
Drawf.shadow(x, y, 24);
|
|
||||||
Draw.rect("pneumatic-drill", x, y, rotation);
|
|
||||||
Drawf.shadow(x, y, 20);
|
|
||||||
Draw.rect(unit.type().icon(Cicon.full), x, y, rotation - 90);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
12
core/src/mindustry/world/blocks/payloads/Payload.java
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
package mindustry.world.blocks.payloads;
|
||||||
|
|
||||||
|
public interface Payload{
|
||||||
|
|
||||||
|
/** draws this payload at a position. */
|
||||||
|
void draw(float x, float y, float rotation);
|
||||||
|
|
||||||
|
/** @return whether this payload was dumped. */
|
||||||
|
default boolean dump(float x, float y, float rotation){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
31
core/src/mindustry/world/blocks/payloads/UnitPayload.java
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
package mindustry.world.blocks.payloads;
|
||||||
|
|
||||||
|
import arc.graphics.g2d.*;
|
||||||
|
import mindustry.gen.*;
|
||||||
|
import mindustry.graphics.*;
|
||||||
|
import mindustry.ui.*;
|
||||||
|
|
||||||
|
public class UnitPayload implements Payload{
|
||||||
|
public Unitc unit;
|
||||||
|
|
||||||
|
public UnitPayload(Unitc unit){
|
||||||
|
this.unit = unit;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean dump(float x, float y, float rotation){
|
||||||
|
unit.set(x, y);
|
||||||
|
unit.rotation(rotation);
|
||||||
|
unit.add();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(float x, float y, float rotation){
|
||||||
|
Drawf.shadow(x, y, 24);
|
||||||
|
Draw.rect("pneumatic-drill", x, y, rotation);
|
||||||
|
Drawf.shadow(x, y, 20);
|
||||||
|
Draw.rect(unit.type().icon(Cicon.full), x, y, rotation - 90);
|
||||||
|
}
|
||||||
|
}
|
||||||