@@ -17,94 +17,106 @@ const sceneDimensions = new SceneDimensions(1, 12, 1, 8);
1717const emptyCustomBackground = new CustomBackground ( sceneDimensions ) ;
1818
1919test ( 'All 8 directions' , ( ) => {
20- const builder = new CharacterDescriptionBuilder ( intl ) ;
20+ const builder = new CharacterDescriptionBuilder ( ) ;
2121
2222 expect ( builder . buildDescription (
2323 new CharacterState ( 1 , 1 , 0 , [ ] , sceneDimensions ) ,
2424 'Sketchpad' ,
25- emptyCustomBackground
25+ emptyCustomBackground ,
26+ intl
2627 ) ) . toBe ( 'At A 1 facing up' ) ;
2728
2829 expect ( builder . buildDescription (
2930 new CharacterState ( 1 , 1 , 1 , [ ] , sceneDimensions ) ,
3031 'Sketchpad' ,
31- emptyCustomBackground
32+ emptyCustomBackground ,
33+ intl
3234 ) ) . toBe ( 'At A 1 facing upper right' ) ;
3335
3436 expect ( builder . buildDescription (
3537 new CharacterState ( 1 , 1 , 2 , [ ] , sceneDimensions ) ,
3638 'Sketchpad' ,
37- emptyCustomBackground
39+ emptyCustomBackground ,
40+ intl
3841 ) ) . toBe ( 'At A 1 facing right' ) ;
3942
4043 expect ( builder . buildDescription (
4144 new CharacterState ( 1 , 1 , 3 , [ ] , sceneDimensions ) ,
4245 'Sketchpad' ,
43- emptyCustomBackground
46+ emptyCustomBackground ,
47+ intl
4448 ) ) . toBe ( 'At A 1 facing lower right' ) ;
4549
4650 expect ( builder . buildDescription (
4751 new CharacterState ( 1 , 1 , 4 , [ ] , sceneDimensions ) ,
4852 'Sketchpad' ,
49- emptyCustomBackground
53+ emptyCustomBackground ,
54+ intl
5055 ) ) . toBe ( 'At A 1 facing down' ) ;
5156
5257 expect ( builder . buildDescription (
5358 new CharacterState ( 1 , 1 , 5 , [ ] , sceneDimensions ) ,
5459 'Sketchpad' ,
55- emptyCustomBackground
60+ emptyCustomBackground ,
61+ intl
5662 ) ) . toBe ( 'At A 1 facing lower left' ) ;
5763
5864 expect ( builder . buildDescription (
5965 new CharacterState ( 1 , 1 , 6 , [ ] , sceneDimensions ) ,
6066 'Sketchpad' ,
61- emptyCustomBackground
67+ emptyCustomBackground ,
68+ intl
6269 ) ) . toBe ( 'At A 1 facing left' ) ;
6370
6471 expect ( builder . buildDescription (
6572 new CharacterState ( 1 , 1 , 7 , [ ] , sceneDimensions ) ,
6673 'Sketchpad' ,
67- emptyCustomBackground
74+ emptyCustomBackground ,
75+ intl
6876 ) ) . toBe ( 'At A 1 facing upper left' ) ;
6977} ) ;
7078
7179test ( 'Space, background description: no, custom background tile: no' , ( ) => {
72- const builder = new CharacterDescriptionBuilder ( intl ) ;
80+ const builder = new CharacterDescriptionBuilder ( ) ;
7381 expect ( builder . buildDescription (
7482 new CharacterState ( 3 , 2 , 2 , [ ] , sceneDimensions ) ,
7583 'Space' ,
76- emptyCustomBackground
84+ emptyCustomBackground ,
85+ intl
7786 ) ) . toBe ( 'At C 2 facing right' ) ;
7887} ) ;
7988
8089test ( 'Space, background description: no, custom background tile: yes' , ( ) => {
81- const builder = new CharacterDescriptionBuilder ( intl ) ;
90+ const builder = new CharacterDescriptionBuilder ( ) ;
8291 expect ( builder . buildDescription (
8392 new CharacterState ( 3 , 2 , 2 , [ ] , sceneDimensions ) ,
8493 'Space' ,
8594 new CustomBackground ( sceneDimensions , [
8695 '0' , '0' , '0' , '0' , '0' , '0' , '0' , '0' , '0' , '0' , '0' , '0' ,
8796 '0' , '0' , '1'
88- ] )
97+ ] ) ,
98+ intl
8999 ) ) . toBe ( 'At C 2 on wall facing right' ) ;
90100} ) ;
91101
92102test ( 'Space, background description: yes, custom background tile: no' , ( ) => {
93- const builder = new CharacterDescriptionBuilder ( intl ) ;
103+ const builder = new CharacterDescriptionBuilder ( ) ;
94104 expect ( builder . buildDescription (
95105 new CharacterState ( 3 , 1 , 2 , [ ] , sceneDimensions ) ,
96106 'Space' ,
97- emptyCustomBackground
107+ emptyCustomBackground ,
108+ intl
98109 ) ) . toBe ( 'At C 1 on the Moon facing right' ) ;
99110} ) ;
100111
101112test ( 'Space, background description: yes, custom background tile: yes' , ( ) => {
102- const builder = new CharacterDescriptionBuilder ( intl ) ;
113+ const builder = new CharacterDescriptionBuilder ( ) ;
103114 expect ( builder . buildDescription (
104115 new CharacterState ( 3 , 1 , 2 , [ ] , sceneDimensions ) ,
105116 'Space' ,
106117 new CustomBackground ( sceneDimensions , [
107118 '0' , '0' , '1'
108- ] )
119+ ] ) ,
120+ intl
109121 ) ) . toBe ( 'At C 1 on wall facing right' ) ;
110122} ) ;
0 commit comments