Commit da431153 authored by matthias's avatar matthias

ServerConfig: private setters

parent 4b15e93b
......@@ -25,35 +25,35 @@ public class ServerConfig extends ConfigParameters {
/* setter */
public void setMaxCycles(int maxCycles) {
private void setMaxCycles(int maxCycles) {
if (maxCycles <= 0) {
throw new IllegalArgumentException("max cycles must be > 0");
}
this.maxCycles = maxCycles;
}
public void setMaxStartInstructions(int maxStartInstructions) {
private void setMaxStartInstructions(int maxStartInstructions) {
if (maxStartInstructions <= 0 || maxStartInstructions > 2000) {
throw new IllegalArgumentException("maxStartInstructions must be > 0 && <= 2000");
}
this.maxStartInstructions = maxStartInstructions;
}
public void setPort(int port) {
private void setPort(int port) {
if (port < 0 || port > 65535) {
throw new IllegalArgumentException("port must be >= 0 && <= 65535");
}
this.port = port;
}
public void setMaxPlayersCount(int maxPlayersCount) {
private void setMaxPlayersCount(int maxPlayersCount) {
if (maxPlayersCount != 1 && maxPlayersCount != 2) {
throw new IllegalArgumentException("maxPlayersCount must be 1 or 2");
}
this.maxPlayersCount = maxPlayersCount;
}
public void setCoreSize(int coreSize) {
private void setCoreSize(int coreSize) {
if (coreSize <= 0) {
throw new IllegalArgumentException("max cycles must be > 0");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment