Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/common-api/filters.js
Show All 22 Lines | return { "func": function(ent){ | ||||
ret = ret && ent.hasClass(cls); | ret = ret && ent.hasClass(cls); | ||||
return ret; | return ret; | ||||
}, | }, | ||||
"dynamicProperties": [] }; | "dynamicProperties": [] }; | ||||
}, | }, | ||||
"byClassesOr": function(clsList){ | "byClassesOr": function(clsList){ | ||||
return { "func": function(ent){ | return { "func": function(ent){ | ||||
let ret = false; | return MatchesClassList(ent.classes(), clsList); | ||||
for (let cls of clsList) | |||||
ret = ret || ent.hasClass(cls); | |||||
return ret; | |||||
}, | }, | ||||
"dynamicProperties": [] }; | "dynamicProperties": [] }; | ||||
}, | }, | ||||
"byMetadata": function(player, key, value){ | "byMetadata": function(player, key, value){ | ||||
return { "func": function(ent){ | return { "func": function(ent){ | ||||
return ent.getMetadata(player, key) == value; | return ent.getMetadata(player, key) == value; | ||||
}, | }, | ||||
▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator