Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/helpers/Player.js
Show First 20 Lines • Show All 284 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
/** | /** | ||||
* Similar to Engine.QueryInterface but first checks if the entity | * Similar to Engine.QueryInterface but first checks if the entity | ||||
* mirages the interface. | * mirages the interface. | ||||
*/ | */ | ||||
function QueryMiragedInterface(ent, iid) | function QueryMiragedInterface(ent, iid) | ||||
{ | { | ||||
var cmp = Engine.QueryInterface(ent, IID_Mirage); | let cmpMirage = Engine.QueryInterface(ent, IID_Mirage); | ||||
if (cmp && !cmp.Mirages(iid)) | if (cmpMirage && !cmpMirage.Mirages(iid)) | ||||
return null; | return null; | ||||
else if (!cmp) | else if (!cmpMirage) | ||||
cmp = Engine.QueryInterface(ent, iid); | return Engine.QueryInterface(ent, iid); | ||||
return cmp; | return cmpMirage.Get(iid); | ||||
} | } | ||||
/** | /** | ||||
* Similar to Engine.QueryInterface, but checks for all interfaces | * Similar to Engine.QueryInterface, but checks for all interfaces | ||||
* implementing a builder list (currently Foundation and Repairable) | * implementing a builder list (currently Foundation and Repairable) | ||||
* TODO Foundation and Repairable could both implement a BuilderList component | * TODO Foundation and Repairable could both implement a BuilderList component | ||||
*/ | */ | ||||
function QueryBuilderListInterface(ent) | function QueryBuilderListInterface(ent) | ||||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator