Show / Hide Table of Contents

Class LambdaAdvancedFactoryBlueprint<TBlueprintID, TBlueprintConfig, TProduced>

An implementation of IAdvancedFactoryBlueprint<TBlueprintID, TBlueprintConfig, TProduced> that allows you to specify a Func object to use as the factory method.

Inheritance
object
LambdaAdvancedFactoryBlueprint<TBlueprintID, TBlueprintConfig, TProduced>
Implements
IAdvancedFactoryBlueprint<TBlueprintID, TBlueprintConfig, TProduced>
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: GoRogue.Factories
Assembly: GoRogue.dll
Syntax
public class LambdaAdvancedFactoryBlueprint<TBlueprintID, TBlueprintConfig, TProduced> : IAdvancedFactoryBlueprint<TBlueprintID, TBlueprintConfig, TProduced>
Type Parameters
Name Description
TBlueprintID

The type being used to identify what object to produce.

TBlueprintConfig

The type of object to pass to the creation function.

TProduced

The type of object being produced.

Remarks

This class may be useful for simple cases where your blueprint has no state, and you simply need to specify some code to run to create the object that takes a parameter. For more complex cases, you may want to implement your own IAdvancedFactoryBlueprint.

Constructors

View Source

LambdaAdvancedFactoryBlueprint(TBlueprintID, Func<TBlueprintConfig, TProduced>)

Constructor.

Declaration
public LambdaAdvancedFactoryBlueprint(TBlueprintID id, Func<TBlueprintConfig, TProduced> factoryMethod)
Parameters
Type Name Description
TBlueprintID id

A unique identifier for this factory blueprint definition.

Func<TBlueprintConfig, TProduced> factoryMethod

The method to call when Create(TBlueprintConfig) is used in order to get the object to return.

Properties

View Source

ID

A unique identifier of this factory definition.

Declaration
public TBlueprintID ID { get; }
Property Value
Type Description
TBlueprintID

Methods

View Source

Create(TBlueprintConfig)

Creates an object of the type specified by TProduced using the given configuration parameters.

Declaration
public TProduced Create(TBlueprintConfig config)
Parameters
Type Name Description
TBlueprintConfig config

Configuration parameters used to create the object.

Returns
Type Description
TProduced

The created object.

Implements

IAdvancedFactoryBlueprint<TBlueprintID, TBlueprintConfig, TProduced>

Extension Methods

Utility.Yield<T>(T)
  • View Source
In this article
Back to top Generated by DocFX