Space Engineers
|
Component that stores custom mod data for an entity. Shared by all mods. NOTE: Create an EntityComponents.sbc with your mod's GUIDs to make sure data is saved. This allows data to remain in the world file until the user removes the mod. More...
Public Member Functions | |
override bool | IsSerialized () |
Tells the component container serializer whether this component should be saved More... | |
override string | GetValue (Guid guid) |
Gets a value from the Storage dictionary with the specified key. More... | |
override bool | TryGetValue (Guid guid, out string value) |
Trys to a value from the Storage dictionary with the specified key. More... | |
override void | SetValue (Guid guid, string value) |
Stores a value with the specified key into the Storage dictionary. More... | |
override bool | RemoveValue (Guid guid) |
Removes a value with the specified key from the Storage dictionary. More... | |
override MyObjectBuilder_ComponentBase | Serialize (bool copy=false) |
override void | Deserialize (MyObjectBuilder_ComponentBase builder) |
Public Member Functions inherited from VRage.Game.Components.MyModStorageComponentBase | |
override MyObjectBuilder_ComponentBase | Serialize (bool copy=false) |
void | Add (KeyValuePair< Guid, string > item) |
void | Add (Guid key, string value) |
void | Clear () |
bool | Contains (KeyValuePair< Guid, string > item) |
bool | ContainsKey (Guid key) |
void | CopyTo (KeyValuePair< Guid, string >[] array, int arrayIndex) |
IEnumerator< KeyValuePair< Guid, string > > | GetEnumerator () |
bool | Remove (KeyValuePair< Guid, string > item) |
bool | Remove (Guid key) |
Public Member Functions inherited from VRage.Game.Components.MyEntityComponentBase | |
override void | OnAddedToContainer () |
Gets called after the container of this component changes More... | |
override void | OnBeforeRemovedFromContainer () |
Gets called before the removal of this component from a container More... | |
Public Member Functions inherited from VRage.Game.Components.MyComponentBase | |
virtual void | SetContainer (MyComponentContainer container) |
Sets the container of this component. Note that the component is not added to the container here! Therefore, use MyComponentContainer.Add(...) method and it will in turn call this method. Actually, you should seldom have the need to call this method yourself. More... | |
virtual T | GetAs< T > () |
virtual void | OnAddedToScene () |
CH: TOOD: Be careful! This does not get called if the component is added to a container that is in the scene already! More... | |
virtual void | OnRemovedFromScene () |
CH: TOOD: Be careful! This does not get called if the component is removed from a container that is still in the scene! More... | |
virtual void | Init (MyComponentDefinitionBase definition) |
Properties | |
IReadOnlyDictionary< Guid, string > | Storage [get] |
Store custom mod data here. Use a GUID unique to your mod. Use only system types, not custom types in mod script or game. More... | |
Properties inherited from VRage.Game.Components.MyModStorageComponentBase | |
override string | ComponentTypeDebugString [get] |
string | this[Guid key] [get, set] |
int | Count [get] |
bool | IsReadOnly [get] |
ICollection< Guid > | Keys [get] |
ICollection< string > | Values [get] |
Properties inherited from VRage.Game.Components.MyEntityComponentBase | |
MyEntityComponentContainer | Container [get] |
IMyEntity | Entity [get] |
abstract string | ComponentTypeDebugString [get] |
Name of the base component type for debug purposes (e.g.: "Position") More... | |
Properties inherited from VRage.Game.Components.MyComponentBase | |
MyComponentContainer | ContainerBase [get] |
This cannot be named Container to not conflict with the definition of Container in MyEntityComponentBase. More... | |
Additional Inherited Members | |
Protected Attributes inherited from VRage.Game.Components.MyModStorageComponentBase | |
IDictionary< Guid, string > | m_storageData = new Dictionary<Guid, string>() |
Events inherited from VRage.Game.Components.MyEntityComponentBase | |
static Action< MyEntityComponentBase > | OnAfterAddedToContainer |
Action< MyEntityComponentBase > | BeforeRemovedFromContainer |
Component that stores custom mod data for an entity. Shared by all mods. NOTE: Create an EntityComponents.sbc with your mod's GUIDs to make sure data is saved. This allows data to remain in the world file until the user removes the mod.
Definition at line 20 of file MyModStorageComponent.cs.
|
inlinevirtual |
Reimplemented from VRage.Game.Components.MyComponentBase.
Definition at line 105 of file MyModStorageComponent.cs.
|
inlinevirtual |
Gets a value from the Storage dictionary with the specified key.
T |
guid |
This can throw exceptions
Implements VRage.Game.Components.MyModStorageComponentBase.
Definition at line 40 of file MyModStorageComponent.cs.
|
inlinevirtual |
Tells the component container serializer whether this component should be saved
Reimplemented from VRage.Game.Components.MyComponentBase.
Definition at line 34 of file MyModStorageComponent.cs.
|
inlinevirtual |
Removes a value with the specified key from the Storage dictionary.
guid |
Implements VRage.Game.Components.MyModStorageComponentBase.
Definition at line 61 of file MyModStorageComponent.cs.
|
inlinevirtual |
Reimplemented from VRage.Game.Components.MyComponentBase.
Definition at line 68 of file MyModStorageComponent.cs.
|
inlinevirtual |
Stores a value with the specified key into the Storage dictionary.
T |
guid | |
value |
Implements VRage.Game.Components.MyModStorageComponentBase.
Definition at line 56 of file MyModStorageComponent.cs.
|
inlinevirtual |
Trys to a value from the Storage dictionary with the specified key.
T |
guid | |
value |
Implements VRage.Game.Components.MyModStorageComponentBase.
Definition at line 45 of file MyModStorageComponent.cs.
|
get |
Store custom mod data here. Use a GUID unique to your mod. Use only system types, not custom types in mod script or game.
This is not synced. Caution, this contains data for all mods. It is recommended to use the appropriate methods instead (GetValue, TryGetValue, SetValue, RemoveValue).
Definition at line 30 of file MyModStorageComponent.cs.