feat: add portal support
This commit is contained in:
@ -36,7 +36,10 @@ public class BaseGameLogicTest {
|
||||
scenarioConfig.scenario = new FieldType[20][20];
|
||||
for(int x = 0; x < scenarioConfig.scenario[0].length; x++) {
|
||||
for(int y = 0; y < scenarioConfig.scenario.length; y++) {
|
||||
if(Math.abs(randomIntegers.next() % 100) < 10) {
|
||||
int r = Math.abs(randomIntegers.next() % 100);
|
||||
if(r < 2) {
|
||||
scenarioConfig.scenario[y][x] = FieldType.PORTAL;
|
||||
}else if(r < 10) {
|
||||
scenarioConfig.scenario[y][x] = FieldType.ROCK;
|
||||
}else {
|
||||
scenarioConfig.scenario[y][x] = FieldType.GRASS;
|
||||
|
@ -83,10 +83,10 @@ class GameLogicTest extends BaseGameLogicTest {
|
||||
snapshot.turnNumber = 10;
|
||||
assertEquals(0, state.turnNumber, "Original's turn number should remain unchanged");
|
||||
|
||||
assertTrue(snapshot.entities.getEntities().hasNext(), "Snapshot should contain cloned entities");
|
||||
assertTrue(snapshot.entities.iterator().hasNext(), "Snapshot should contain cloned entities");
|
||||
|
||||
((Rock)snapshot.entities.getEntities().next()).decreaseHp(5);
|
||||
assertEquals(100, ((Rock)state.entities.getEntities().next()).getHp(), "Original's rock entity hp should remain unchanged");
|
||||
((Rock)snapshot.entities.iterator().next()).decreaseHp(5);
|
||||
assertEquals(100, ((Rock)state.entities.iterator().next()).getHp(), "Original's rock entity hp should remain unchanged");
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user