Skip to content

Commit

Permalink
Made changes suggested by @skaldarnar
Browse files Browse the repository at this point in the history
  • Loading branch information
agent-q1 committed Apr 16, 2020
1 parent b4ad368 commit 5c8f613
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public class SettlementEntityManager extends BaseComponentSystem {
private int minDistance = 500;
private int settlementMaxRadius = 150;
private int cyclesLeft; // 1 cycle = approx. 20 seconds
private int NUMBER_OF_CYCLES_ON_RESET = 2;
private int cyclesBeforeGrowth = 2;
private Random rng;
private Multimap<String, String> roadCache = MultimapBuilder.hashKeys().hashSetValues().build();

Expand All @@ -147,7 +147,7 @@ public void postBegin() {
settlementEntities = settlementCachingSystem.getSettlementCacheEntity();
long seed = regionEntityManager.hashCode() & 0x921233;
rng = new FastRandom(seed);
cyclesLeft = NUMBER_OF_CYCLES_ON_RESET;
cyclesLeft = cyclesBeforeGrowth;

}

Expand Down Expand Up @@ -189,7 +189,7 @@ public void onWorldTimeEvent(WorldTimeEvent worldTimeEvent, EntityRef entityRef)
build(settlement);
buildRoads(settlement);
}
cyclesLeft = NUMBER_OF_CYCLES_ON_RESET;
cyclesLeft = cyclesBeforeGrowth;
}

/**
Expand Down Expand Up @@ -720,7 +720,7 @@ private boolean checkIfTerrainIsBuildable(Rect2i area) {
*/

public void setCityCyclesBeforeGrowth(int cycles){
NUMBER_OF_CYCLES_ON_RESET = cycles;
cyclesBeforeGrowth = cycles;
}

}

0 comments on commit 5c8f613

Please sign in to comment.