Clean up code, replace switch and try-with-resource where possible.

This commit is contained in:
Đạt Nhân Trương
2022-08-07 21:51:10 +07:00
parent f983b4dccf
commit 0ef3e69638
22 changed files with 609 additions and 589 deletions

View File

@@ -128,12 +128,16 @@ public class Snowball {
if (this.hits == 0) {
this.position += 1;
if (this.position == 45) {
switch (this.position) {
case 45:
map.getSnowball(team == 0 ? 1 : 0).message(1);
} else if (this.position == 290) {
break;
case 290:
map.getSnowball(team == 0 ? 1 : 0).message(2);
} else if (this.position == 560) {
break;
case 560:
map.getSnowball(team == 0 ? 1 : 0).message(3);
break;
}
this.hits = 3;