campaign progress
This commit is contained in:
@@ -24,7 +24,7 @@ public class SectorInfo{
|
||||
/** Export statistics. */
|
||||
public ObjectMap<Item, ExportStat> export = new ObjectMap<>();
|
||||
/** Items stored in all cores. */
|
||||
public ObjectIntMap<Item> coreItems = new ObjectIntMap<>();
|
||||
public ItemSeq coreItems = new ItemSeq();
|
||||
/** The best available core type. */
|
||||
public Block bestCoreType = Blocks.air;
|
||||
/** Max storage capacity. */
|
||||
@@ -80,7 +80,7 @@ public class SectorInfo{
|
||||
if(entity != null){
|
||||
ItemModule items = entity.items;
|
||||
for(int i = 0; i < items.length(); i++){
|
||||
coreItems.put(content.item(i), items.get(i));
|
||||
coreItems.set(content.item(i), items.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public class SectorInfo{
|
||||
bestCoreType = !hasCore ? Blocks.air : state.rules.defaultTeam.cores().max(e -> e.block.size).block;
|
||||
storageCapacity = entity != null ? entity.storageCapacity : 0;
|
||||
|
||||
//update sector's internal time spent counter1
|
||||
//update sector's internal time spent counter
|
||||
state.rules.sector.setTimeSpent(internalTimeSpent);
|
||||
}
|
||||
|
||||
@@ -100,6 +100,12 @@ public class SectorInfo{
|
||||
|
||||
internalTimeSpent += Time.delta;
|
||||
|
||||
//autorun turns
|
||||
if(internalTimeSpent >= turnDuration){
|
||||
internalTimeSpent = 0;
|
||||
universe.runTurn();
|
||||
}
|
||||
|
||||
//create last stored core items
|
||||
if(lastCoreItems == null){
|
||||
lastCoreItems = new int[content.items().size];
|
||||
|
||||
Reference in New Issue
Block a user