Skip to content

Commit

Permalink
Various formatting changes and cleaning up some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dloe committed Sep 12, 2024
1 parent bbc24ab commit 72dbc6b
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 108 deletions.
2 changes: 0 additions & 2 deletions core/src/mindustry/core/Logic.java
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,6 @@ public void runWave(){
Events.fire(new WaveEvent());
}



private void checkGameState(){
//campaign maps do not have a 'win' state!
if(state.isCampaign()){
Expand Down
4 changes: 3 additions & 1 deletion core/src/mindustry/entities/comp/BuildingComp.java
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,9 @@ public void transferLiquid(Building next, float amount, Liquid liquid){

/**
* Keep optimal flow with no leaks
* Used in Testing scenarios
* @param liquid
* @return
* @return output flow
*/
public float moveLiquidForwardDummy(Liquid liquid)
{
Expand Down Expand Up @@ -921,6 +922,7 @@ public float moveLiquid(Building next, Liquid liquid){
float fract = liquids.get(liquid) / block.liquidCapacity * block.liquidPressure;
float flow = Math.min(Mathf.clamp((fract - ofract)) * (block.liquidCapacity), liquids.get(liquid));
flow = Math.min(flow, next.block.liquidCapacity - next.liquids.get(liquid));

if(flow > 0f && ofract <= fract && next.acceptLiquid(self(), liquid)){
next.handleLiquid(self(), liquid, flow);
liquids.remove(liquid, flow);
Expand Down
8 changes: 0 additions & 8 deletions core/src/mindustry/world/BlockStub.java

This file was deleted.

3 changes: 2 additions & 1 deletion core/src/mindustry/world/Tile.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ public Tile(int x, int y, int floor, int overlay, int wall){
this(x, y, content.block(floor), content.block(overlay), content.block(wall));
}

//for mocking
/** Constructor used primarily in mocking scenarios in test suites. */
public Tile()
{
block = floor = overlay = (Floor)Blocks.air;
}

/** Mocking scenarios in test suites. */
public void constructTile(Tile tile)
{
this.x = tile.x;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,6 @@ protected boolean validateTarget(){
return !Units.invalidateTarget(target, canHeal() ? Team.derelict : team, x, y) || isControlled() || logicControlled();
}


protected boolean canHeal(){
return targetHealing && hasAmmo() && peekAmmo().collidesTeam && peekAmmo().heals();
}
Expand Down
1 change: 1 addition & 0 deletions core/src/mindustry/world/blocks/liquid/Conduit.java
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ public void updateTile(){
}
}

/** Using in test suite for updating optimal liquid flow for testing purposes. */
public void updateTileDummyFlow()
{
smoothLiquid = Mathf.lerpDelta(smoothLiquid, liquids.currentAmount() / liquidCapacity, 0.05f);
Expand Down
Loading

0 comments on commit 72dbc6b

Please sign in to comment.