Class TreeFlyweight
- Namespace
- WitShells.DesignPatterns.Core
Example IFlyweight that stores shared tree mesh and texture data. Many tree instances in the scene can reference a single TreeFlyweight; each instance provides its own position via the extrinsic state argument.
public class TreeFlyweight : IFlyweight
- Inheritance
-
TreeFlyweight
- Implements
- Inherited Members
Fields
Mesh
Shared mesh asset name/path (intrinsic state).
public string Mesh
Field Value
Texture
Shared texture asset name/path (intrinsic state).
public string Texture
Field Value
Methods
Operation(object)
Draws this tree using the shared mesh/texture and the per-instance position
provided via extrinsicState.
public void Operation(object extrinsicState)
Parameters
extrinsicStateobjectThe world position (or transform) of this particular tree instance.