-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added settlement growth rate function #58
Conversation
@@ -132,7 +132,8 @@ | |||
|
|||
private int minDistance = 500; | |||
private int settlementMaxRadius = 150; | |||
private int cyclesLeft = 2; // 1 cycle = approx. 20 seconds | |||
private int cyclesLeft; // 1 cycle = approx. 20 seconds | |||
private int NumberOfCyclesOnReset = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pleas use lower case names for variables. If this should be a constant, it should be
private static final int NUMBER_OF_CYCLES_ON_RESET = 2;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private int NumberOfCyclesOnReset = 2; | |
private int numberOfCyclesOnReset = 2; |
src/main/java/org/terasology/dynamicCities/settlements/SettlementEntityManager.java
Show resolved
Hide resolved
*/ | ||
|
||
public void setCityCyclesBeforeGrowth(int cycles){ | ||
NUMBER_OF_CYCLES_ON_RESET = cycles; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you are setting the value of NUMBER_OF_CYCLES_ON_RESET
here this cannot be a constant. Thus, it should not be capitalized.
@@ -132,7 +132,8 @@ | |||
|
|||
private int minDistance = 500; | |||
private int settlementMaxRadius = 150; | |||
private int cyclesLeft = 2; // 1 cycle = approx. 20 seconds | |||
private int cyclesLeft; // 1 cycle = approx. 20 seconds | |||
private int NUMBER_OF_CYCLES_ON_RESET = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As pointed out down in setCityCyclesBeforeGrowth
this member is both read and written, thus, it cannot be a constant.
As setCityCyclesBeforeGrowth
seems to be a good name, deriving the member name from the setter method would yield
private int cyclesBeforeGrowth = 2;
If you want to learn more about constants in Java you may start reading here:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright! I got a bit confused about what constants could mean. It all depends on context doesn't it. However, thanks a lot for those resources!. Really helped me clear out some of the concepts for me. I'll go ahead and make that change!
* expose set and buffer block events * expose request raster target event * create new vector references in block event constructors * don't expose internal vector references
Looks like there are unrelated changes in this PR... Looks like the come from #31 but I'm not sure why they show up in here again... |
Closing in favor of #59 |
Related to Terasology/MetalRenegades#50 .
Adds a function that exposes DynamicCities to other modules so that they can change the settlement growth rate.