Unit cargo transport system

This commit is contained in:
Anuken
2021-11-29 20:06:49 -05:00
parent 635027bb81
commit 6483d924af
32 changed files with 631 additions and 115 deletions

View File

@@ -785,17 +785,19 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
}
/** Dumps any item with an accumulator. May dump multiple times per frame. Use with care. */
public void dumpAccumulate(){
dumpAccumulate(null);
public boolean dumpAccumulate(){
return dumpAccumulate(null);
}
/** Dumps any item with an accumulator. May dump multiple times per frame. Use with care. */
public void dumpAccumulate(Item item){
public boolean dumpAccumulate(Item item){
boolean res = false;
dumpAccum += delta();
while(dumpAccum >= 1f){
dump(item);
res |= dump(item);
dumpAccum -=1f;
}
return res;
}
/** Try dumping any item near the building. */

View File

@@ -1,5 +1,6 @@
package mindustry.entities.comp;
import arc.util.*;
import mindustry.annotations.Annotations.*;
import mindustry.game.*;
import mindustry.gen.*;
@@ -11,7 +12,7 @@ abstract class BuildingTetherComp implements Unitc{
@Import UnitType type;
@Import Team team;
public Building building;
public @Nullable Building building;
@Override
public void update(){