Class DefaultGroupPlacementStrategy
- Namespace
- RandomizerCore.Randomization
- Assembly
- RandomizerCore.dll
A simple placement strategy. Provides support for standard and coupled groups, along with a field which allows weighting placements according to logical depth.
public class DefaultGroupPlacementStrategy : GroupPlacementStrategy
- Inheritance
-
DefaultGroupPlacementStrategy
- Inherited Members
Constructors
DefaultGroupPlacementStrategy(DepthPriorityTransformHandler)
public DefaultGroupPlacementStrategy(DefaultGroupPlacementStrategy.DepthPriorityTransformHandler depthPriorityTransform)
Parameters
depthPriorityTransform
DefaultGroupPlacementStrategy.DepthPriorityTransformHandler
DefaultGroupPlacementStrategy(float)
public DefaultGroupPlacementStrategy(float depthPriorityScalingFactor)
Parameters
depthPriorityScalingFactor
float
Fields
depthPriorityTransform
Invoked on the minimum priority locations of each sphere to modify the priority used to select the location for item.
Item priority depth is the number of spheres such that the average priority of their forced progression items is less than the priority of item.
public DefaultGroupPlacementStrategy.DepthPriorityTransformHandler depthPriorityTransform
Field Value
Properties
ConstraintList
If any of the constraints in this list are not satisfied, then the placement will be rejected unless no alternatives exist.
public List<DefaultGroupPlacementStrategy.Constraint> ConstraintList { get; }
Property Value
Methods
CanPlace(IRandoItem, IRandoLocation)
protected bool CanPlace(IRandoItem item, IRandoLocation location)
Parameters
item
IRandoItemlocation
IRandoLocation
Returns
Clone()
Creates a copy of the strategy that can be used for another group.
public override GroupPlacementStrategy Clone()
Returns
InvokeOnConstraintViolated(IRandoItem, IRandoLocation)
protected void InvokeOnConstraintViolated(IRandoItem item, IRandoLocation location)
Parameters
item
IRandoItemlocation
IRandoLocation
PlaceCoupledGroup(CoupledRandomizationGroup, Sphere, Sphere, TempState)
public override List<RandoPlacement> PlaceCoupledGroup(CoupledRandomizationGroup group, Sphere sphere, Sphere dualSphere, TempState placementState)
Parameters
group
CoupledRandomizationGroupsphere
SpheredualSphere
SphereplacementState
TempState
Returns
PlaceGroup(RandomizationGroup, Sphere, TempState)
public override List<RandoPlacement> PlaceGroup(RandomizationGroup group, Sphere sphere, TempState placementState)
Parameters
group
RandomizationGroupsphere
SphereplacementState
TempState
Returns
Reset()
Called before rerandomization, or if the randomizer resets for subsequent attempts.
public override void Reset()
SelectNext(Sphere, List<SortedArrayList<IRandoLocation>>, SortedArrayList<float>, IRandoItem, out int, out int, out float)
public IRandoLocation SelectNext(Sphere s, List<SortedArrayList<IRandoLocation>> locations, SortedArrayList<float> meanSphereProgressionPriorities, IRandoItem item, out int itemPriorityDepth, out int locationDepth, out float locationPriority)
Parameters
s
Spherelocations
List<SortedArrayList<IRandoLocation>>meanSphereProgressionPriorities
SortedArrayList<float>item
IRandoItemitemPriorityDepth
intlocationDepth
intlocationPriority
float
Returns
Events
Constraints
If any of the subscribers to this event return false, then the placement will be rejected unless no alternatives exist.
[Obsolete("Use ConstraintList instead")]
public event Func<IRandoItem, IRandoLocation, bool> Constraints
Event Type
OnConstraintViolated
Event for when no reachable locations satisfy the constraint for item.
Raise OutOfLocationsException to trigger rerandomization. Raise other exceptions to halt randomization.
[Obsolete("Use Constraint.Fail with ConstraintList instead.")]
public event Action<IRandoItem, IRandoLocation>? OnConstraintViolated