Skip to content

Commit 4b865f0

Browse files
authored
Merge pull request #1 from bryanbecker/master
Fix Memory
2 parents 886dbad + dc9983f commit 4b865f0

File tree

6 files changed

+29
-16
lines changed

6 files changed

+29
-16
lines changed

dist/screeps.d.ts

+16-8
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ interface Creep extends RoomObject {
454454
/**
455455
* A shorthand to Memory.creeps[creep.name]. You can use it for quick access the creep’s specific memory data object.
456456
*/
457-
memory: any;
457+
memory: CreepMemory;
458458
/**
459459
* Whether it is your creep or foe.
460460
*/
@@ -656,7 +656,7 @@ interface Flag extends RoomObject {
656656
/**
657657
* A shorthand to Memory.flags[flag.name]. You can use it for quick access the flag's specific memory data object.
658658
*/
659-
memory: any;
659+
memory: FlagMemory;
660660
/**
661661
* Flag’s name. You can choose the name while creating a new flag, and it cannot be changed later. This name is a hash key to access the spawn via the Game.flags object.
662662
*/
@@ -1155,18 +1155,26 @@ interface OrderFilter {
11551155
interface Memory {
11561156
[name: string]: any;
11571157
creeps: {
1158-
[name: string]: any;
1158+
[name: string]: CreepMemory;
11591159
};
11601160
flags: {
1161-
[name: string]: any;
1161+
[name: string]: FlagMemory;
11621162
};
11631163
rooms: {
1164-
[name: string]: any;
1164+
[name: string]: RoomMemory;
11651165
};
11661166
spawns: {
1167-
[name: string]: any;
1167+
[name: string]: SpawnMemory;
11681168
};
11691169
}
1170+
interface CreepMemory {
1171+
}
1172+
interface FlagMemory {
1173+
}
1174+
interface RoomMemory {
1175+
}
1176+
interface SpawnMemory {
1177+
}
11701178
/**
11711179
* A mineral deposit object. Can be harvested by creeps with a WORK body part using the extractor structure.
11721180
*/
@@ -1702,7 +1710,7 @@ interface Room {
17021710
/**
17031711
* A shorthand to Memory.rooms[room.name]. You can use it for quick access the room’s specific memory data object.
17041712
*/
1705-
memory: any;
1713+
memory: RoomMemory;
17061714
/**
17071715
* One of the following constants:
17081716
* MODE_SIMULATION, MODE_SURVIVAL, MODE_WORLD, MODE_ARENA
@@ -1899,7 +1907,7 @@ interface StructureSpawn extends OwnedStructure {
18991907
/**
19001908
* A shorthand to Memory.spawns[spawn.name]. You can use it for quick access the spawn’s specific memory data object.
19011909
*/
1902-
memory: any;
1910+
memory: SpawnMemory;
19031911
/**
19041912
* Spawn’s name. You choose the name upon creating a new spawn, and it cannot be changed later. This name is a hash key to access the spawn via the Game.spawns object.
19051913
*/

src/creep.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ interface Creep extends RoomObject {
4242
/**
4343
* A shorthand to Memory.creeps[creep.name]. You can use it for quick access the creep’s specific memory data object.
4444
*/
45-
memory: any;
45+
memory: CreepMemory;
4646
/**
4747
* Whether it is your creep or foe.
4848
*/

src/flag.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface Flag extends RoomObject {
1111
/**
1212
* A shorthand to Memory.flags[flag.name]. You can use it for quick access the flag's specific memory data object.
1313
*/
14-
memory: any;
14+
memory: FlagMemory;
1515
/**
1616
* Flag’s name. You can choose the name while creating a new flag, and it cannot be changed later. This name is a hash key to access the spawn via the Game.flags object.
1717
*/

src/memory.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
interface Memory {
22
[name: string]: any;
3-
creeps: {[name: string]: any};
4-
flags: {[name: string]: any};
5-
rooms: {[name: string]: any};
6-
spawns: {[name: string]: any};
3+
creeps: {[name: string]: CreepMemory};
4+
flags: {[name: string]: FlagMemory};
5+
rooms: {[name: string]: RoomMemory};
6+
spawns: {[name: string]: SpawnMemory};
77
}
8+
9+
interface CreepMemory {}
10+
interface FlagMemory {}
11+
interface RoomMemory {}
12+
interface SpawnMemory {}

src/room.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface Room {
1919
/**
2020
* A shorthand to Memory.rooms[room.name]. You can use it for quick access the room’s specific memory data object.
2121
*/
22-
memory: any;
22+
memory: RoomMemory;
2323
/**
2424
* One of the following constants:
2525
* MODE_SIMULATION, MODE_SURVIVAL, MODE_WORLD, MODE_ARENA

src/spawn.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface StructureSpawn extends OwnedStructure {
1515
/**
1616
* A shorthand to Memory.spawns[spawn.name]. You can use it for quick access the spawn’s specific memory data object.
1717
*/
18-
memory: any;
18+
memory: SpawnMemory;
1919
/**
2020
* Spawn’s name. You choose the name upon creating a new spawn, and it cannot be changed later. This name is a hash key to access the spawn via the Game.spawns object.
2121
*/

0 commit comments

Comments
 (0)