Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Comment:
Migrated to Confluence 5.3
Overview
Excerpt |
---|
Quickly determine if a structure of the specified type has been fully built. |
Availability
...
Code
Code Block | |
---|---|
|
...
|
...
// iHave( |
...
structureTypeOrID) returns true if you have // at least one of those structures fully built var |
...
iHave = |
...
(function( |
...
) |
...
{ |
...
var buildingIsBuilt = function(building) { return building.status == BUILT; } return function (structure) { return enumStruct(me,structure).some(buildingIsBuilt); } })(); |
Example
Code Block | |
---|---|
|
...
| |||||
// You need a HQ before you can design units or build defence towers
if (iHave(HQ)) {
// build defence towers
} else {
// instruct a truck to build a HQ!
} |
Div | ||
---|---|---|
| ||
AvailabilityRequires:
|
Div | ||
---|---|---|
| ||
See alsoRelates articles:
|