Ripple tint change / Minor optimization
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.0 KiB |
@@ -33,7 +33,7 @@ public class ContentLoader{
|
|||||||
|
|
||||||
public ContentLoader(){
|
public ContentLoader(){
|
||||||
for(ContentType type : ContentType.all){
|
for(ContentType type : ContentType.all){
|
||||||
contentMap[type.ordinal()] = new Seq<>();
|
contentMap[type.ordinal()] = new Seq<>(type.contentClass == null ? Object.class : type.contentClass);
|
||||||
contentNameMap[type.ordinal()] = new ObjectMap<>();
|
contentNameMap[type.ordinal()] = new ObjectMap<>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1006,15 +1006,20 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
|
|
||||||
if(proximity.size == 0) return false;
|
if(proximity.size == 0) return false;
|
||||||
|
|
||||||
|
var allItems = content.items();
|
||||||
|
int itemSize = allItems.size;
|
||||||
|
Item[] itemArray = allItems.items;
|
||||||
|
|
||||||
for(int i = 0; i < proximity.size; i++){
|
for(int i = 0; i < proximity.size; i++){
|
||||||
Building other = proximity.get((i + dump) % proximity.size);
|
Building other = proximity.get((i + dump) % proximity.size);
|
||||||
|
|
||||||
if(todump == null){
|
if(todump == null){
|
||||||
|
|
||||||
for(int ii = 0; ii < content.items().size; ii++){
|
for(int ii = 0; ii < itemSize; ii++){
|
||||||
Item item = content.item(ii);
|
if(!items.has(ii)) continue;
|
||||||
|
Item item = itemArray[ii];
|
||||||
|
|
||||||
if(other.team == team && items.has(item) && other.acceptItem(self(), item) && canDump(other, item)){
|
if(other.acceptItem(self(), item) && canDump(other, item)){
|
||||||
other.handleItem(self(), item);
|
other.handleItem(self(), item);
|
||||||
items.remove(item, 1);
|
items.remove(item, 1);
|
||||||
incrementDump(proximity.size);
|
incrementDump(proximity.size);
|
||||||
@@ -1022,7 +1027,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(other.team == team && other.acceptItem(self(), todump) && canDump(other, todump)){
|
if(other.acceptItem(self(), todump) && canDump(other, todump)){
|
||||||
other.handleItem(self(), todump);
|
other.handleItem(self(), todump);
|
||||||
items.remove(todump, 1);
|
items.remove(todump, 1);
|
||||||
incrementDump(proximity.size);
|
incrementDump(proximity.size);
|
||||||
|
|||||||
Reference in New Issue
Block a user