Opened 3 years ago

Last modified 3 years ago

#5985 closed defect

Improve mirage internals. — at Version 1

Reported by: Freagarach Owned by:
Priority: Should Have Milestone: Alpha 25
Component: Simulation Keywords:
Cc: Patch:

Description (last modified by Freagarach)

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.

So:

  • 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?

Change History (1)

comment:1 by Freagarach, 3 years ago

Description: modified (diff)

In 25068:

Clean mirage internals.

Use a map that stores the functions instead of them being part of the Mirage component.
Means that a lot doesn't need to be inited now (refs. #5979).

Ticket: #5985
Differential revision: D3694
Comments by: @wraitii

Note: See TracTickets for help on using tickets.