@ -8,6 +8,7 @@ import de.tims.fleetstorm.matchfield.Matchfield;
public class Logic {
private Matchfield matchfield;
private Coordinate lastShot;
public Coordinate chooseField(Matchfield matchfield) {
@ -46,4 +47,13 @@ public class Logic {
return lastShot;
}
public void setMatchfield(Matchfield matchfield) {
this.matchfield = matchfield;
public Matchfield getMatchfield() {
return matchfield;
@ -83,4 +83,20 @@ class LogicTest {
@Test
void testSetMatchfield() {
Logic logic = new Logic();
Matchfield matchfield;
int size = 4;
matchfield = new Matchfield(size);
matchfield.createMatchfield();
Matchfield result = logic.getMatchfield();
assertEquals(result, null);
logic.setMatchfield(matchfield);
result = logic.getMatchfield();
assertNotNull(result);