|
1 |
| -/* |
2 |
| - * Module code goes here. Use 'module.exports' to export things: |
3 |
| - * module.exports.thing = 'a thing'; |
| 1 | +/** |
| 2 | + * A series of helper functions designed to quickly calculate extra statuses of each creep. |
| 3 | + * Uses creep as a parameter and acts as static calculation functions. |
4 | 4 | *
|
5 |
| - * You can import it from another modules like this: |
6 |
| - * var mod = require('status.creep'); |
7 |
| - * mod.thing == 'a thing'; // true |
| 5 | + * @type {Object} |
8 | 6 | */
|
9 |
| - |
10 |
| - |
11 | 7 | module.exports = {
|
12 | 8 |
|
13 | 9 | /**
|
14 |
| - * This helper method returns a number corresponding to the number of ticks required for a creep to move one |
15 |
| - * square on plains (minimum is 1). This method is rendered useless in other contexts and should only be used for |
16 |
| - * referential speed of creeps. |
| 10 | + * Returns a number corresponding to the number of ticks required for a creep to move one square on plains. |
| 11 | + * This method is rendered useless in other contexts and should only be used for referential speed of creeps. |
17 | 12 | *
|
18 | 13 | * @param creepToCalculate The creep to perform the calculation on.
|
19 | 14 | * @return {number} The relative speed of the creep in number of ticks per 1 square of movement.
|
@@ -52,8 +47,8 @@ module.exports = {
|
52 | 47 | },
|
53 | 48 |
|
54 | 49 | /**
|
55 |
| - * Calculates the total weight of a creep as determined by whether it is carrying anything and how many |
56 |
| - * non-MOVE body parts it has. |
| 50 | + * Calculates the total weight of a creep as determined by how many non-MOVE body parts it has. |
| 51 | + * Takes into account whether the creep is carrying anything. |
57 | 52 | *
|
58 | 53 | * @param creepToCalculate The creep to perform the calculation on.
|
59 | 54 | * @return {number} The current calculated weight for the creep.
|
@@ -93,8 +88,8 @@ module.exports = {
|
93 | 88 | },
|
94 | 89 |
|
95 | 90 | /**
|
96 |
| - * This method will calculate the number of ticks required for a creep to reach the nearest spawn within their |
97 |
| - * current room, using pos.findPathTo(), room.getTerrain(), and speed() to properly calculate the required ticks. |
| 91 | + * Calculates the number of ticks required for a creep to reach the nearest spawn within their current room. |
| 92 | + * Uses pos.findPathTo(), room.getTerrain(), and it's speed to properly calculate the required ticks. |
98 | 93 | *
|
99 | 94 | * Only works to calculate for the path in the current room.
|
100 | 95 | *
|
|
0 commit comments