massive improvement to Team

This commit is contained in:
2018-04-11 16:39:58 +02:00
parent 14d67eb323
commit 016a2e2bbb
4 changed files with 88 additions and 148 deletions

View File

@@ -1,30 +1,24 @@
import worms.model.Team;
import worms.model.Worm;
import worms.util.Coordinate;
import java.io.Console;
public class Main {
public static void main(String[] args) {
System.out.println(4/3);
System.out.println(4.0/3.0);
/*
System.out.println("Hello World!");
Console console = System.console();
double input = Double.parseDouble(console.readLine("Enter your %d (th) passport number: ", 2));
System.out.println(input);
System.out.println((int)input);*/
System.out.println(1/2);
System.out.println(1.0/2.0);
Worm worm1 = new Worm(Coordinate.create(0.0, 0.0), 0.0, "Alpha", 1.0);
Worm worm2 = new Worm(Coordinate.create(0.0, 0.0), 0.0, "Beta", 1.0);
Worm worm3 = new Worm(Coordinate.create(0.0, 0.0), 0.0, "Gamma", 1.0);
Worm worm4 = new Worm(Coordinate.create(0.0, 0.0), 0.0, "Delta", 1.0);
System.out.println(8 + 11 % 2);
System.out.println((8 + 11) % 2);
}
Team team1 = new Team(null, "TestTeam");
private static int minRadius = 50;
private static double radius;
public static void setRadius(double radius2) {
if (radius2 < minRadius) {
throw new IllegalArgumentException("Radius is smaller than " + minRadius);
}
radius = radius2;
team1.addWorm(worm1);
team1.addWorm(worm2);
team1.addWorm(worm3);
team1.addWorm(worm4);
team1.getAllWormsOfTeam();
}
}