added test
This commit is contained in:
@@ -6,17 +6,18 @@ import worms.util.IllegalNameException;
|
|||||||
|
|
||||||
import static java.lang.Math.*;
|
import static java.lang.Math.*;
|
||||||
|
|
||||||
public class Worm {
|
|
||||||
/**
|
/**
|
||||||
* a class with the specifications of the worm
|
* a class with the specifications of the worm
|
||||||
*
|
*
|
||||||
* @invar the location of the worm must be a valid location
|
* @invar the location of the worm must be a valid location
|
||||||
* |...
|
* |...
|
||||||
* @invar
|
* @invar
|
||||||
*
|
*
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @author Arthur Bols and Leen Dereu
|
* @author Arthur Bols and Leen Dereu
|
||||||
*/
|
*/
|
||||||
|
public class Worm {
|
||||||
|
|
||||||
|
|
||||||
// region properties
|
// region properties
|
||||||
//===================================================================================
|
//===================================================================================
|
||||||
@@ -24,7 +25,6 @@ public class Worm {
|
|||||||
// Location
|
// Location
|
||||||
private Tuple<Double, Double> location;
|
private Tuple<Double, Double> location;
|
||||||
|
|
||||||
|
|
||||||
// jumping
|
// jumping
|
||||||
private Tuple<Double, Double> oldLocation;
|
private Tuple<Double, Double> oldLocation;
|
||||||
|
|
||||||
@@ -332,11 +332,11 @@ public class Worm {
|
|||||||
* are equal to the maximum points. If the given points are lower then 0
|
* are equal to the maximum points. If the given points are lower then 0
|
||||||
* the current points are equal to 0. If the given points is between the
|
* the current points are equal to 0. If the given points is between the
|
||||||
* maximum points and 0, the current points is equal to the given points
|
* maximum points and 0, the current points is equal to the given points
|
||||||
* |if (points > this.maxPoints)
|
* |if (points > this.maxActionPoints)
|
||||||
* | points = this.maxPoints
|
* | actionPoints = this.maxActionPoints
|
||||||
* |else if (points < 0)
|
* |else if (actionPoints < 0)
|
||||||
* | points = 0
|
* | actionPoints = 0
|
||||||
* |this.points = points
|
* |this.actionPoints = actionPoints
|
||||||
*/
|
*/
|
||||||
public void setActionPoints(long actionPoints) {
|
public void setActionPoints(long actionPoints) {
|
||||||
|
|
||||||
@@ -506,7 +506,7 @@ public class Worm {
|
|||||||
if (numberSteps < 0)
|
if (numberSteps < 0)
|
||||||
throw new IllegalArgumentException(); // TODO add decent exception msg
|
throw new IllegalArgumentException(); // TODO add decent exception msg
|
||||||
|
|
||||||
int cost = (int) ceil(abs(cos(this.orientation)) + abs(4 * sin(this.orientation)));
|
long cost = (long) ceil(abs(cos(this.orientation)) + abs(4 * sin(this.orientation)));
|
||||||
if (cost > this.actionPoints)
|
if (cost > this.actionPoints)
|
||||||
throw new IllegalArgumentException(); // TODO add decent exception msg
|
throw new IllegalArgumentException(); // TODO add decent exception msg
|
||||||
|
|
||||||
|
80
OGP1718-Worms/tests/worms/model/WormTest.java
Normal file
80
OGP1718-Worms/tests/worms/model/WormTest.java
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
package worms.model;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
class WormTest {
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
void setUp() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getLocation() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getOrientation() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getRadius() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void setRadius() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getMinimumRadius() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getMass() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getActionPoints() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getMaxActionPoints() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void setActionPoints() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void decreaseActionPoints() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getName() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void setName() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void move() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void turn() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void jump() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void jumpTime() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void jumpStep() {
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user