< Dice‎ | PbP‎ | RollPost

RollPost._pristine Field

From DiceRoller Documentation

Backing field for Pristine/PristineList.

  • Namespace: Dice.PbP
  • Assembly: DiceRoller (in DiceRoller.dll)

Syntax

private List<RollResult> _pristine;

Field Value

Type: System.Collections.Generic.List<Dice.RollResult>

Backing field for Pristine/PristineList. Initialized to an empty list in the default constructor. When deserializing, this is an empty list until OnDeserialization is called, at which point it will be filled out.

PristineList is directly initialized to the deserialized RollResult[] array in the deserializing constructor, and that is converted into a List<RollResult> in OnDeserialization. In that callback, PristineList is then set to _pristine rather than directly storing the array. This is done because the array is deserialized before array elements, so at the time of the deserialization constructor all elements in the array are null. It is not until OnDeserialization is called that the array elements are filled in, and if it is converted to a List first, the nulls will never be replaced with their proper values.