Class ItemPersistentData
Contains the persistent data for each component and worldobject itself deriving IPersistentData, allowing that data to be preserved and
restored as the object is placed and put down. This is stored on the WorldObjectItem when the WorldObject is picked up, and on the WorldObject itself when it's placed.
Inheritance
System.Object
ItemPersistentData
Implements
System.ComponentModel.INotifyPropertyChanged
Assembly: Eco.Gameplay.dll
Syntax
public class ItemPersistentData : Object, IPermanentDestroyHandler, IController, IViewController, IHasUniversalID, INotifyPropertyChanged, IThreadSafeSubscriptions, ISubscriptions<ThreadSafeSubscriptions>, ISubscriptions
Constructors
ItemPersistentData()
Declaration
public ItemPersistentData()
Fields
Clickable tooltip section, triggers ClearOnRequest (see ResetDataTooltip).
Declaration
public TextLinkButton ResetButton
Field Value
Properties
ControllerID
Declaration
public ref int ControllerID { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
Entries
Declaration
public ControllerDictionary<Type, object> Entries { get; set; }
Property Value
PersistentControllers
Declaration
[NewTooltipChildren]
public IEnumerable<IController> PersistentControllers { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.IEnumerable<IController> |
|
Subscriptions
Declaration
public ref ThreadSafeSubscriptions Subscriptions { get; }
Property Value
Methods
ClearOnRequest(Player)
Declaration
public void ClearOnRequest(Player player)
Parameters
| Type |
Name |
Description |
| Player |
player |
|
ClearOnTrade()
Declaration
public void ClearOnTrade()
OnPermanentDestroy()
Declaration
public void OnPermanentDestroy()
SetPersistentData<TComponent>(Object)
Sets persistent data for the component of type TComponent. If data is null then removes component data.
Declaration
public void SetPersistentData<TComponent>(object data)
where TComponent : IPersistentData
Parameters
| Type |
Name |
Description |
| System.Object |
data |
|
Type Parameters
| Name |
Description |
| TComponent |
|
ShowResetDialog(TooltipOrigin, TooltipClickContext, User)
A dialog to be shown when the reset button is clicked.
Declaration
public void ShowResetDialog(TooltipOrigin origin, TooltipClickContext context, User user)
Parameters
TryAddPersistentDataFromComponent(IPersistentData)
Tries to add PersistentData from component if it wasn't previously added.
Declaration
public bool TryAddPersistentDataFromComponent(IPersistentData component)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
TryGetPersistentData<TComponent>(out Object)
Declaration
public bool TryGetPersistentData<TComponent>(out object data)
where TComponent : IPersistentData
Parameters
| Type |
Name |
Description |
| System.Object |
data |
|
Returns
| Type |
Description |
| System.Boolean |
|
Type Parameters
| Name |
Description |
| TComponent |
|
TryRestorePersistentDataToComponent(IPersistentData)
Tries to restore data to PersistentData of component if it is in . If restored successfully then corresponding entry removed.
Declaration
public bool TryRestorePersistentDataToComponent(IPersistentData component)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Events
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
| Type |
Description |
| System.ComponentModel.PropertyChangedEventHandler |
|
Implements
System.ComponentModel.INotifyPropertyChanged
Extension Methods