Class MappedLinkedIdTranslator<T>
ObjectLinkIdTranslator<T> implementation with mapping between link id and object implementing IHasUniversalID for not-entity objects (without own identity).
This mapping required for ensuring that link id is always mapped to same object for tooltip caching.
I.e. Vector3Tooltip may be created from link id string and doesn't have own identity, fully defined by content in the link id, but client may want to cache the tooltip by universal id.
So instead of creating new Vector3Tooltip object every time it will create it on demand (if not yet exists)
and then just return same object with same universal id every time when same link id requested.
Inheritance
System.Object
MappedLinkedIdTranslator<T>
Assembly: Eco.Gameplay.dll
Syntax
public abstract class MappedLinkedIdTranslator<T> : ObjectLinkIdTranslator<T>, IObjectLinkIdTranslator where T : ILinkable, IHasUniversalID
Type Parameters
Constructors
MappedLinkedIdTranslator()
Declaration
protected MappedLinkedIdTranslator()
Methods
CreateTypedLinkTarget(String)
Creates new T
object by content of linkId
.
Declaration
protected abstract T CreateTypedLinkTarget(string linkId)
Parameters
Type |
Name |
Description |
System.String |
linkId |
|
Returns
GetTypedLinkTarget(String)
Returns mapped IHasUniversalID for linkId
or creates new if not yet mapped.
Declaration
protected sealed override T GetTypedLinkTarget(string linkId)
Parameters
Type |
Name |
Description |
System.String |
linkId |
|
Returns
Overrides
Eco.Gameplay.Systems.TextLinks.ObjectLinkIdTranslator<T>.GetTypedLinkTarget(System.String)
Implements
Extension Methods