File tree 2 files changed +23
-4
lines changed
2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -22,4 +22,16 @@ describe("main", () => {
22
22
it ( "should return void when called with no context" , ( ) => {
23
23
assert . isUndefined ( loop ( ) ) ;
24
24
} ) ;
25
+
26
+ it ( "Automatically delete memory of missing creeps" , ( ) => {
27
+ Memory . creeps . persistValue = "any value" ;
28
+ Memory . creeps . notPersistValue = "any value" ;
29
+
30
+ Game . creeps . persistValue = "any value" ;
31
+
32
+ loop ( ) ;
33
+
34
+ assert . isDefined ( Memory . creeps . persistValue ) ;
35
+ assert . isUndefined ( Memory . creeps . notPersistValue ) ;
36
+ } ) ;
25
37
} ) ;
Original file line number Diff line number Diff line change 1
- export const Game = {
2
- creeps : [ ] ,
1
+ export const Game : {
2
+ creeps : { [ name : string ] : any } ;
3
+ rooms : any ;
4
+ spawns : any ;
5
+ time : any ;
6
+ } = {
7
+ creeps : { } ,
3
8
rooms : [ ] ,
4
9
spawns : { } ,
5
10
time : 12345
6
11
} ;
7
12
8
- export const Memory = {
9
- creeps : [ ]
13
+ export const Memory : {
14
+ creeps : { [ name : string ] : any } ;
15
+ } = {
16
+ creeps : { }
10
17
} ;
You can’t perform that action at this time.
0 commit comments