equipments #22
@@ -1,2 +0,0 @@
|
|||||||
public class Bäckahäst extends Monster implements CanMove, CanAttack {
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package Monster;
|
||||||
|
|
||||||
public enum Attacks {
|
public enum Attacks {
|
||||||
CHILL(3, 2);
|
CHILL(3, 2);
|
||||||
|
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package Monster;
|
||||||
|
|
||||||
public enum Biomes {
|
public enum Biomes {
|
||||||
GRASSLAND, MOUNTAIN, COAST, FOREST //Är inte fäst vid dessa
|
GRASSLAND, MOUNTAIN, COAST, FOREST //Är inte fäst vid dessa
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package Monster;
|
||||||
|
|
||||||
import Entity.Player;
|
import Entity.Player;
|
||||||
|
|
||||||
public interface CanAttack {
|
public interface CanAttack {
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package Monster;
|
||||||
|
|
||||||
import Entity.Position;
|
import Entity.Position;
|
||||||
//Är detta ett ok namn?
|
//Är detta ett ok namn?
|
||||||
public interface CanMove {
|
public interface CanMove {
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package Monster;
|
||||||
|
|
||||||
import Entity.*;
|
import Entity.*;
|
||||||
|
|
||||||
public abstract class Monster implements CanMove {
|
public abstract class Monster implements CanMove {
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package Monster;
|
||||||
|
|
||||||
import Entity.Position;
|
import Entity.Position;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
8
src/main/java/Monster/Nixie.java
Normal file
8
src/main/java/Monster/Nixie.java
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
package Monster;
|
||||||
|
|
||||||
|
public abstract class Nixie extends Monster implements CanMove, CanAttack {
|
||||||
|
|
||||||
|
public Nixie() {
|
||||||
|
super(0,0,Monster.DEFAULT_POSITION);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
package Monster;
|
||||||
|
|
||||||
import Entity.Player;
|
import Entity.Player;
|
||||||
import Entity.Position;
|
import Entity.Position;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
8
src/main/java/Monster/Troll.java
Normal file
8
src/main/java/Monster/Troll.java
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
package Monster;
|
||||||
|
|
||||||
|
public abstract class Troll extends Monster implements CanMove, CanAttack {
|
||||||
|
|
||||||
|
public Troll() {
|
||||||
|
super(0,0,Monster.DEFAULT_POSITION);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
public class Troll extends Monster implements CanMove, CanAttack {
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,7 @@
|
|||||||
import Action.*;
|
|
||||||
import Character.*;
|
|
||||||
import Combat.*;
|
|
||||||
import Entity.*;
|
import Entity.*;
|
||||||
import Inventory.*;
|
import Monster.Attacks;
|
||||||
import Job.*;
|
import Monster.MovementPatterns;
|
||||||
import Shared.*;
|
import Monster.Shade;
|
||||||
|
|
||||||
import org.junit.jupiter.api.*;
|
import org.junit.jupiter.api.*;
|
||||||
|
|
||||||
@@ -13,7 +10,7 @@ import java.util.*;
|
|||||||
import static org.hamcrest.MatcherAssert.*;
|
import static org.hamcrest.MatcherAssert.*;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.*;
|
||||||
|
|
||||||
|
|
||||||
public class MonsterTest {
|
public class MonsterTest {
|
||||||
@@ -65,6 +62,13 @@ public class MonsterTest {
|
|||||||
assertThat(legalDestinations, hasItem(defaultShade.getPosition()));
|
assertThat(legalDestinations, hasItem(defaultShade.getPosition()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shade_wont_move_to_same_position_as_player() {
|
||||||
|
Position destination = new Position(1, 1);
|
||||||
|
when(defaultPlayer.getPosition()).thenReturn(destination);
|
||||||
|
assertThat(defaultShade.moveTo(destination), equalTo(false));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void monster_cannot_do_anything_when_out_of_energy() {
|
void monster_cannot_do_anything_when_out_of_energy() {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user