|
|
@ -14,8 +14,14 @@ void main() {
|
|
|
|
'loads correctly',
|
|
|
|
'loads correctly',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
await game.ready();
|
|
|
|
await game.ready();
|
|
|
|
final leftBaseboard = Baseboard.left(position: Vector2.zero());
|
|
|
|
final leftBaseboard = Baseboard(
|
|
|
|
final rightBaseboard = Baseboard.right(position: Vector2.zero());
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
|
|
|
side: BoardSide.left,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
final rightBaseboard = Baseboard(
|
|
|
|
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
|
|
|
side: BoardSide.right,
|
|
|
|
|
|
|
|
);
|
|
|
|
await game.ensureAddAll([leftBaseboard, rightBaseboard]);
|
|
|
|
await game.ensureAddAll([leftBaseboard, rightBaseboard]);
|
|
|
|
|
|
|
|
|
|
|
|
expect(game.contains(leftBaseboard), isTrue);
|
|
|
|
expect(game.contains(leftBaseboard), isTrue);
|
|
|
@ -28,7 +34,10 @@ void main() {
|
|
|
|
'positions correctly',
|
|
|
|
'positions correctly',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final position = Vector2.all(10);
|
|
|
|
final position = Vector2.all(10);
|
|
|
|
final baseboard = Baseboard.left(position: position);
|
|
|
|
final baseboard = Baseboard(
|
|
|
|
|
|
|
|
position: position,
|
|
|
|
|
|
|
|
side: BoardSide.left,
|
|
|
|
|
|
|
|
);
|
|
|
|
await game.ensureAdd(baseboard);
|
|
|
|
await game.ensureAdd(baseboard);
|
|
|
|
game.contains(baseboard);
|
|
|
|
game.contains(baseboard);
|
|
|
|
|
|
|
|
|
|
|
@ -39,7 +48,10 @@ void main() {
|
|
|
|
flameTester.test(
|
|
|
|
flameTester.test(
|
|
|
|
'is static',
|
|
|
|
'is static',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final baseboard = Baseboard.left(position: Vector2.zero());
|
|
|
|
final baseboard = Baseboard(
|
|
|
|
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
|
|
|
side: BoardSide.left,
|
|
|
|
|
|
|
|
);
|
|
|
|
await game.ensureAdd(baseboard);
|
|
|
|
await game.ensureAdd(baseboard);
|
|
|
|
|
|
|
|
|
|
|
|
expect(baseboard.body.bodyType, equals(BodyType.static));
|
|
|
|
expect(baseboard.body.bodyType, equals(BodyType.static));
|
|
|
@ -49,8 +61,14 @@ void main() {
|
|
|
|
flameTester.test(
|
|
|
|
flameTester.test(
|
|
|
|
'is at an angle',
|
|
|
|
'is at an angle',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final leftBaseboard = Baseboard.left(position: Vector2.zero());
|
|
|
|
final leftBaseboard = Baseboard(
|
|
|
|
final rightBaseboard = Baseboard.right(position: Vector2.zero());
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
|
|
|
side: BoardSide.left,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
final rightBaseboard = Baseboard(
|
|
|
|
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
|
|
|
side: BoardSide.right,
|
|
|
|
|
|
|
|
);
|
|
|
|
await game.ensureAddAll([leftBaseboard, rightBaseboard]);
|
|
|
|
await game.ensureAddAll([leftBaseboard, rightBaseboard]);
|
|
|
|
|
|
|
|
|
|
|
|
expect(leftBaseboard.body.angle, isNegative);
|
|
|
|
expect(leftBaseboard.body.angle, isNegative);
|
|
|
@ -63,7 +81,10 @@ void main() {
|
|
|
|
flameTester.test(
|
|
|
|
flameTester.test(
|
|
|
|
'has three',
|
|
|
|
'has three',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final baseboard = Baseboard.left(position: Vector2.zero());
|
|
|
|
final baseboard = Baseboard(
|
|
|
|
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
|
|
|
side: BoardSide.left,
|
|
|
|
|
|
|
|
);
|
|
|
|
await game.ensureAdd(baseboard);
|
|
|
|
await game.ensureAdd(baseboard);
|
|
|
|
|
|
|
|
|
|
|
|
expect(baseboard.body.fixtures.length, equals(3));
|
|
|
|
expect(baseboard.body.fixtures.length, equals(3));
|
|
|
|