Class RoomShapesHandlerGrid2D<TNode, TConfiguration>
Class responsible for returning available shapes for a node based on used repeat mode.
Inheritance
System.Object
RoomShapesHandlerGrid2D<TNode, TConfiguration>
Assembly: Edgar.dll
Syntax
public class RoomShapesHandlerGrid2D<TNode, TConfiguration> : Object, IRoomShapesHandler<ILayout<TNode, TConfiguration>, TNode, RoomTemplateInstanceGrid2D>, IRandomInjectable where TConfiguration : IRoomConfiguration<TNode>, IShapeConfiguration<RoomTemplateInstanceGrid2D>, ISmartCloneable<TConfiguration>, new()
Type Parameters
Name |
Description |
TNode |
|
TConfiguration |
|
Constructors
RoomShapesHandlerGrid2D(TwoWayDictionary<RoomTemplateInstanceGrid2D, IntAlias<PolygonGrid2D>>, ILevelDescription<TNode>, Dictionary<TNode, List<WeightedShape>>, Nullable<RoomTemplateRepeatMode>, Nullable<RoomTemplateRepeatMode>)
Declaration
public RoomShapesHandlerGrid2D(TwoWayDictionary<RoomTemplateInstanceGrid2D, IntAlias<PolygonGrid2D>> intAliasMapping, ILevelDescription<TNode> mapDescription, Dictionary<TNode, List<WeightedShape>> shapesForNodes, Nullable<RoomTemplateRepeatMode> repeatModeOverride = null, Nullable<RoomTemplateRepeatMode> repeatModeDefault = null)
Parameters
Methods
CanPerturbShapeDoNotUse(TNode)
Declaration
public bool CanPerturbShapeDoNotUse(TNode node)
Parameters
Type |
Name |
Description |
TNode |
node |
|
Returns
Type |
Description |
System.Boolean |
|
GetPossibleShapesForNode(ILayout<TNode, TConfiguration>, TNode, Boolean)
Gets all the possible shapes based on repeat modes.
If zero shapes are found and tryToFixEmpty is set to true, we try to lower the requirements and e.g. use
only the NoImmediate mode instead of the NoRepeat mode.
Declaration
public List<RoomTemplateInstanceGrid2D> GetPossibleShapesForNode(ILayout<TNode, TConfiguration> layout, TNode node, bool tryToFixEmpty = false)
Parameters
Type |
Name |
Description |
ILayout<TNode, TConfiguration> |
layout |
|
TNode |
node |
|
System.Boolean |
tryToFixEmpty |
|
Returns
GetRandomShapeWithoutConstraintsDoNotUse(TNode)
Declaration
public RoomTemplateInstanceGrid2D GetRandomShapeWithoutConstraintsDoNotUse(TNode node)
Parameters
Type |
Name |
Description |
TNode |
node |
|
Returns
InjectRandomGenerator(Random)
Declaration
public void InjectRandomGenerator(Random random)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
Implements