forked from Garethp/ScreepsAutocomplete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Structure.js
87 lines (80 loc) · 2.1 KB
/
Structure.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/**
* The base prototype object of all structures.
* @class
* @extends {RoomObject}
*
* @see {@link https://docs.screeps.com/api/#Structure}
*/
Structure = function() { };
Structure.prototype =
{
/**
* The current amount of hit points of the structure.
*
* @see {@link https://docs.screeps.com/api/#Structure.hits}
*
* @type {number}
*/
hits: 0,
/**
* The total amount of hit points of the structure.
*
* @see {@link https://docs.screeps.com/api/#Structure.hitsMax}
*
* @type {number}
*/
hitsMax: 0,
/**
* A unique object identificator.
* You can use Game.getObjectById method to retrieve an object instance by its id.
*
* @see {@link https://docs.screeps.com/api/#Structure.id}
*
* @type {string}
*/
id: "",
/**
* One of the STRUCTURE_* constants.
*
* @see {@link https://docs.screeps.com/api/#Structure.structureType}
*
* @type {string}
*/
structureType: "",
/**
* Destroy this structure immediately.
*
* @see {@link https://docs.screeps.com/api/#Structure.destroy}
*
* @type {function}
*
* @return {number|OK|ERR_NOT_OWNER|ERR_BUSY}
*/
destroy: function() { },
/**
* Check whether this structure can be used.
* If room controller level is insufficient,
* then this method will return false, and the structure will be highlighted with red in the game.
*
* @see {@link https://docs.screeps.com/api/#Structure.isActive}
*
* @type {function}
*
* @return {boolean}
*/
isActive: function() { },
/**
* Toggle auto notification when the structure is under attack.
* The notification will be sent to your account email.
* Turned on by default.
*
* @see {@link https://docs.screeps.com/api/#Structure.notifyWhenAttacked}
*
* @type {function}
*
* @param {boolean} enabled Whether to enable notification or disable.
*
* @return {number|OK|ERR_NOT_OWNER|ERR_INVALID_ARGS}
*/
notifyWhenAttacked: function(enabled) { }
};