monster #20
@ -1,2 +0,0 @@
|
||||
public class Bäckahäst extends Monster implements CanMove, CanAttack {
|
||||
}
|
||||
@ -1,3 +1,5 @@
|
||||
package Monster;
|
||||
|
||||
public enum Attacks {
|
||||
CHILL(3, 2);
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
package Monster;
|
||||
|
||||
public enum Biomes {
|
||||
GRASSLAND, MOUNTAIN, COAST, FOREST //Är inte fäst vid dessa
|
||||
}
|
||||
@ -1,3 +1,5 @@
|
||||
package Monster;
|
||||
|
||||
import Entity.Player;
|
||||
|
||||
public interface CanAttack {
|
||||
@ -1,3 +1,5 @@
|
||||
package Monster;
|
||||
|
||||
import Entity.Position;
|
||||
//Är detta ett ok namn?
|
||||
public interface CanMove {
|
||||
@ -1,3 +1,5 @@
|
||||
package Monster;
|
||||
|
||||
import Entity.*;
|
||||
|
||||
public abstract class Monster implements CanMove {
|
||||
@ -1,3 +1,5 @@
|
||||
package Monster;
|
||||
|
||||
import Entity.Position;
|
||||
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.Position;
|
||||
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 Inventory.*;
|
||||
import Job.*;
|
||||
import Shared.*;
|
||||
import Monster.Attacks;
|
||||
import Monster.MovementPatterns;
|
||||
import Monster.Shade;
|
||||
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
@ -13,7 +10,7 @@ import java.util.*;
|
||||
import static org.hamcrest.MatcherAssert.*;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
|
||||
public class MonsterTest {
|
||||
@ -65,6 +62,13 @@ public class MonsterTest {
|
||||
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
|
||||
void monster_cannot_do_anything_when_out_of_energy() {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user