Power graph removal
This commit is contained in:
@@ -157,6 +157,9 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void removeFromProximity(){
|
public void removeFromProximity(){
|
||||||
|
if(power != null){
|
||||||
|
tile.block().powerGraphRemoved(tile);
|
||||||
|
}
|
||||||
GridPoint2[] nearby = Edges.getEdges(tile.block().size);
|
GridPoint2[] nearby = Edges.getEdges(tile.block().size);
|
||||||
for(GridPoint2 point : nearby){
|
for(GridPoint2 point : nearby){
|
||||||
Tile other = world.tile(tile.x + point.x, tile.y + point.y);
|
Tile other = world.tile(tile.x + point.x, tile.y + point.y);
|
||||||
|
|||||||
@@ -159,6 +159,10 @@ public class Block extends BaseBlock {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void powerGraphRemoved(Tile tile){
|
||||||
|
tile.entity.power.graph.remove(tile);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isLayer(Tile tile){
|
public boolean isLayer(Tile tile){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class PowerGraph{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void remove(Tile tile){
|
public void remove(Tile tile){
|
||||||
all.add(tile);
|
all.remove(tile);
|
||||||
producers.remove(tile);
|
producers.remove(tile);
|
||||||
consumers.remove(tile);
|
consumers.remove(tile);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user