Namespace: GGG.Items
Convenience creation methods for callers that identify items by catalog ID.
public static class ItemCatalogFactoryExtensions
Inheritance
object ← ItemCatalogFactoryExtensions
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Methods
Create(IItemFactory, ItemCatalog, string)
Creates a new runtime instance for the specified item definition.
public static ItemInstance Create(this IItemFactory factory, ItemCatalog catalog, string definitionId)
Parameters
factory IItemFactory
The item factory to use.
catalog ItemCatalog
The catalog used to resolve definitions.
definitionId string
The stable identifier of the item definition.
Returns
A newly created item instance.
Restore(IItemFactory, ItemCatalog, string, string)
Restores a runtime item instance using a previously assigned identifier.
public static ItemInstance Restore(this IItemFactory factory, ItemCatalog catalog, string definitionId, string instanceId)
Parameters
factory IItemFactory
The item factory to use.
catalog ItemCatalog
The catalog used to resolve definitions.
definitionId string
The stable identifier of the item definition.
instanceId string
The identifier to preserve on the restored item.
Returns
The restored item instance.