1
1
package org .bk .ass .sim ;
2
2
3
3
import org .bk .ass .PositionOutOfBoundsException ;
4
- import org .bk .ass .sim .Simulator .SimulatorBuilder ;
4
+ import org .bk .ass .sim .Simulator .Builder ;
5
5
import org .junit .jupiter .api .BeforeAll ;
6
6
import org .junit .jupiter .api .Test ;
7
7
import org .openbw .bwapi4j .test .BWDataProvider ;
13
13
14
14
class SimulatorTest {
15
15
16
- private Simulator simulator = new SimulatorBuilder ().build ();
16
+ private Simulator simulator = new Builder ().build ();
17
17
private BWAPI4JAgentFactory factory = new BWAPI4JAgentFactory (null );
18
18
19
19
@ BeforeAll
@@ -108,7 +108,7 @@ void MMvsMM() {
108
108
@ Test
109
109
void MMvsMM_FS4 () {
110
110
// GIVEN
111
- simulator = new SimulatorBuilder ().withFrameSkip (4 ).build ();
111
+ simulator = new Builder ().withFrameSkip (4 ).build ();
112
112
simulator .addAgentA (factory .of (UnitType .Terran_Marine ));
113
113
simulator .addAgentA (factory .of (UnitType .Terran_Marine ));
114
114
simulator .addAgentA (factory .of (UnitType .Terran_Marine ));
@@ -657,7 +657,7 @@ void archonSplashShouldNotAffectOwnUnits() {
657
657
@ Test
658
658
void goonShouldDieWhenRunningAwayFromScout () {
659
659
// GIVEN
660
- simulator = new SimulatorBuilder ().withPlayerABehavior (new RetreatBehavior ()).build ();
660
+ simulator = new Builder ().withPlayerABehavior (new RetreatBehavior ()).build ();
661
661
simulator .addAgentA (factory .of (UnitType .Protoss_Dragoon ).setX (500 ));
662
662
simulator .addAgentB (factory .of (UnitType .Protoss_Scout ).setX (495 ));
663
663
@@ -704,7 +704,7 @@ void shouldResetCollisions() {
704
704
@ Test
705
705
void shouldNotAttackStasisedUnitsNorBeAttackedByThem () {
706
706
// GIVEN
707
- simulator = new SimulatorBuilder ().build ();
707
+ simulator = new Builder ().build ();
708
708
simulator .addAgentA (factory .of (UnitType .Terran_Goliath ).setX (500 ).setStasised (true ));
709
709
simulator .addAgentB (factory .of (UnitType .Terran_Wraith ).setX (495 ));
710
710
@@ -719,7 +719,7 @@ void shouldNotAttackStasisedUnitsNorBeAttackedByThem() {
719
719
@ Test
720
720
void shouldAttackLockeddownUnitsButDontBeAttackedByThem () {
721
721
// GIVEN
722
- simulator = new SimulatorBuilder ().build ();
722
+ simulator = new Builder ().build ();
723
723
simulator .addAgentA (factory .of (UnitType .Terran_Goliath ).setX (500 ).setLockeddown (true ));
724
724
simulator .addAgentB (factory .of (UnitType .Terran_Wraith ).setX (495 ));
725
725
@@ -734,7 +734,7 @@ void shouldAttackLockeddownUnitsButDontBeAttackedByThem() {
734
734
@ Test
735
735
void shouldNotRepairStasisedUnit () {
736
736
// GIVEN
737
- simulator = new SimulatorBuilder ().build ();
737
+ simulator = new Builder ().build ();
738
738
simulator .addAgentA (
739
739
factory .of (UnitType .Terran_Goliath ).setX (500 ).setStasised (true ).setHealth (97 ));
740
740
simulator .addAgentA (factory .of (UnitType .Terran_SCV ).setX (500 ));
@@ -749,7 +749,7 @@ void shouldNotRepairStasisedUnit() {
749
749
@ Test
750
750
void shouldRepairLockeddownUnit () {
751
751
// GIVEN
752
- simulator = new SimulatorBuilder ().build ();
752
+ simulator = new Builder ().build ();
753
753
simulator .addAgentA (
754
754
factory .of (UnitType .Terran_Goliath ).setX (500 ).setLockeddown (true ).setHealth (97 ));
755
755
simulator .addAgentA (factory .of (UnitType .Terran_SCV ).setX (500 ));
@@ -897,7 +897,7 @@ void reaverVs12Lings() {
897
897
@ Test
898
898
void lingsVsZealots_FS3 () {
899
899
// GIVEN
900
- simulator = new SimulatorBuilder ().withFrameSkip (3 ).build ();
900
+ simulator = new Builder ().withFrameSkip (3 ).build ();
901
901
simulator .addAgentA (factory .of (UnitType .Protoss_Zealot ));
902
902
simulator .addAgentA (factory .of (UnitType .Protoss_Zealot ));
903
903
@@ -908,7 +908,7 @@ void lingsVsZealots_FS3() {
908
908
simulator .addAgentB (factory .of (UnitType .Zerg_Zergling ));
909
909
910
910
// WHEN
911
- simulator .simulate (- 1 );
911
+ simulator .simulate (250 );
912
912
913
913
// THEN
914
914
assertThat (simulator .getAgentsA ()).size ().isOne ();
0 commit comments