Skip to content

Commit a3d2c65

Browse files
committed
version 1.0
1 parent 7a830a1 commit a3d2c65

11 files changed

Lines changed: 17 additions & 9 deletions

File tree

Client/Client.iml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
<orderEntry type="sourceFolder" forTests="false" />
1010
<orderEntry type="module" module-name="Common" />
1111
<orderEntry type="library" name="gson-2.3.1" level="project" />
12+
<orderEntry type="module" module-name="common" />
1213
</component>
1314
</module>

Mithosis/Mithosis.iml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
<orderEntry type="module" module-name="Common" />
1111
<orderEntry type="library" name="gson-2.3.1" level="project" />
1212
<orderEntry type="module" module-name="Server" />
13+
<orderEntry type="module" module-name="common" />
1314
</component>
1415
</module>

Mithosis/src/core/Context.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public boolean addCell(Cell cell) {
202202

203203
private void calculateRelationVisiblePos(int depthOfField) {
204204
if (relatedVisiblePositionsFromOdd.size() != relatedVisiblePositionsFromEven.size()) {
205-
System.out.println("error!! calculateRelationVisiblePos!");
205+
// System.out.println("error!! calculateRelationVisiblePos!");
206206
}
207207
if (relatedVisiblePositionsFromOdd.size() == 0) {
208208
Position[] positions = new Position[1];

Mithosis/src/core/model/Cell.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ public boolean mitosis() {
9595
{
9696
continue;
9797
}
98+
if(ctx.getMap().at(tPos).getType().equals(Constants.BLOCK_TYPE_IMPASSABLE))
99+
{
100+
continue;
101+
}
98102
int currentHeight = ctx.getMap().at(position).getHeight();
99103
int nextHeight = ctx.getMap().at(tPos).getHeight();
100104
if (nextHeight > currentHeight + 1) {
@@ -172,7 +176,7 @@ public boolean gainResource () {
172176
if( blockResource < gainRate) {
173177
gain = blockResource;
174178
}
175-
else if(gainRate + blockResource > ServerConstants.CELL_MAX_ENERGY)
179+
else if(gainRate + energy > ServerConstants.CELL_MAX_ENERGY)
176180
{
177181
gain = ServerConstants.CELL_MAX_ENERGY - energy;
178182
}

Mithosis/src/core/model/Map.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static Map load(Context ctx, String dir) throws IOException, IOException
6565

6666
File file = new File(dir);
6767
String json = new String(Files.readAllBytes(file.toPath()), ServerConstants.MAP_FILE_ENCODING);
68-
System.out.println(json);
68+
// System.out.println(json);
6969
FileStructure fs = new Gson().fromJson(json, FileStructure.class);
7070

7171
// create map

Server/Server.iml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
<orderEntry type="sourceFolder" forTests="false" />
1010
<orderEntry type="module" module-name="Common" />
1111
<orderEntry type="library" name="gson-2.3.1" level="project" />
12+
<orderEntry type="module" module-name="common" />
1213
</component>
1314
</module>

Server/src/server/core/GameHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public void run() {
263263

264264
while (!shutdownRequest) {
265265
long start = System.currentTimeMillis();
266-
System.out.println(start);
266+
// System.out.println(start);
267267
try {
268268
simulate.call();
269269
} catch (Exception e) {

Terminal/Terminal.iml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
<orderEntry type="sourceFolder" forTests="false" />
1010
<orderEntry type="library" name="gson-2.3.1" level="project" />
1111
<orderEntry type="module" module-name="Common" />
12+
<orderEntry type="module" module-name="common" />
1213
</component>
1314
</module>

common/src/model/Position.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public Position getNextPos (Direction dir) {
3232
case SOUTH_WEST:
3333
return new Position(x - 1, y - 1);
3434
default:
35-
System.out.println("in chi bud dadi?!?!");
35+
// System.out.println("in chi bud dadi?!?!");
3636
return null;
3737
}
3838
} else {
@@ -50,7 +50,7 @@ public Position getNextPos (Direction dir) {
5050
case SOUTH_WEST:
5151
return new Position(x - 1, y);
5252
default:
53-
System.out.println("in chi bud dadi?!?!");
53+
// System.out.println("in chi bud dadi?!?!");
5454
return null;
5555
}
5656
}

common/src/network/JsonSocket.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public boolean isClosed() {
112112
*/
113113
public void send(Object obj) throws IOException {
114114
String json = mGson.toJson(obj);
115-
System.out.println("send : " + json);
115+
// System.out.println("send : " + json);
116116
byte buffer[] = json.getBytes(ENCODING);
117117
mOut.write(buffer, 0, buffer.length);
118118
mOut.write('\0');
@@ -160,7 +160,7 @@ public <T> T get(Class<T> classOfInput) throws IOException {
160160
buffer[total++] = (byte) current;
161161
}
162162
String json = new String(buffer, 0, total, ENCODING);
163-
System.out.println("receive : " + json);
163+
// System.out.println("receive : " + json);
164164
return mGson.fromJson(json, classOfInput);
165165
}
166166

0 commit comments

Comments
 (0)