RandomizableAdjustment

Class in ChivalrousGames.Common

Description

Configuration for a Vector3 adjustment with optional params to randomize it

Fields

adjustment Vector3 This modification is always applied and occurs before randomization
randomize bool Indicates whether this RandomizableAdjustment is to be randomized. If true, will use range random values and randomize after adjustment.
randomX FloatRange The x min and max value used in random calculation
randomY FloatRange The y min and max value used in random calculation
randomZ FloatRange The z min and max value used in random calculation

Constructors

Constructor
RandomizableAdjustment();
Return
RandomizableAdjustment A new instance of RandomizableAdjustment
Description

Default constructor. Creates a new instance of RandomizableAdjustment

Constructor
public RandomizableAdjustment(Vector3 adjustment, bool randomize, FloatRange randomX, FloatRange randomY, FloatRange randomZ);
Parameters
adjustment Vector3 This modification is always applied and occurs before randomization
randomize bool Indicates whether this RandomizableAdjustment is to be randomized. If true, will use range random values and randomize after adjustment.
randomX FloatRange The x min and max value used in random calculation
randomY FloatRange The y min and max value used in random calculation
randomZ FloatRange The z min and max value used in random calculation
Return
RandomizableAdjustment A new instance of RandomizableAdjustment
Description

Creates a new instance of RandomizableAdjustment and initializes it with params.

Methods

GetRandomizedValue
public virtual Vector3 GetRandomizedValue(ChivalrousGames.Common.Random random);
Parameters
random ChivalrousGames.Common.Random The random to use to select the random value
Return
Vector3 The randomized value
Description

Gets a randomized Vector3 based on the specified random and class fields. This value is then stored in the RandomizableAdjustment and will only be generated again after ClearRandomizedValue is called. If GetRandomizedValue is called multiple times before ClearRandomizedValue is called, the same value is always returned.

ClearRandomizedValue
public void ClearRandomizedValue();
Description

Clears the randomized value. Allows the RandomizableAdjustment to be randomized again by calling GetRandomizedValue.

Clone
public RandomizableAdjustment Clone();
Return
RandomizableAdjustment A memberwise clone of the current RandomizableAdjustment
Description

Returns a memberwise clone of the current RandomizableAdjustment