Improve mirage internals.
|Reported by:||Freagarach||Owned by:||Freagarach|
|Priority:||Should Have||Milestone:||Alpha 25|
Description (last modified by )
Currently, mirages implement the functions they mirage "bare metal", i.e. cmpMirage.GetCurrentAmount() returns the saved amount of resources for the miraged entity. That will give problems when multiple components implement the same function name.
The calling function
QueryMiragedInterface in the Player.js-helper, could just as well return an object belonging to the miraged component.
- Save the functions and values in an object, per component, in Mirage.js.
- Change the function call to return the object instead of calling functions on cmpMirage.
While at it, I suggest more stuff:
- Don't initialise null values (refs #5979).
- Make the components responsible for what needs to be miraged?