Table of Contents

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

DefaultGroupPlacementStrategy.DepthPriorityTransformHandler

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

List<DefaultGroupPlacementStrategy.Constraint>

Methods

CanPlace(IRandoItem, IRandoLocation)

protected bool CanPlace(IRandoItem item, IRandoLocation location)

Parameters

item IRandoItem
location IRandoLocation

Returns

bool

Clone()

Creates a copy of the strategy that can be used for another group.

public override GroupPlacementStrategy Clone()

Returns

GroupPlacementStrategy

InvokeOnConstraintViolated(IRandoItem, IRandoLocation)

protected void InvokeOnConstraintViolated(IRandoItem item, IRandoLocation location)

Parameters

item IRandoItem
location IRandoLocation

PlaceCoupledGroup(CoupledRandomizationGroup, Sphere, Sphere, TempState)

public override List<RandoPlacement> PlaceCoupledGroup(CoupledRandomizationGroup group, Sphere sphere, Sphere dualSphere, TempState placementState)

Parameters

group CoupledRandomizationGroup
sphere Sphere
dualSphere Sphere
placementState TempState

Returns

List<RandoPlacement>

PlaceGroup(RandomizationGroup, Sphere, TempState)

public override List<RandoPlacement> PlaceGroup(RandomizationGroup group, Sphere sphere, TempState placementState)

Parameters

group RandomizationGroup
sphere Sphere
placementState TempState

Returns

List<RandoPlacement>

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 Sphere
locations List<SortedArrayList<IRandoLocation>>
meanSphereProgressionPriorities SortedArrayList<float>
item IRandoItem
itemPriorityDepth int
locationDepth int
locationPriority float

Returns

IRandoLocation

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

Func<IRandoItem, IRandoLocation, bool>

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

Event Type

Action<IRandoItem, IRandoLocation>