C# Class fCraft.MapGeneration.MapGeneratorParameters

Represents a set of map generator parameters. Provides a way to serialize these parameters to string, and a way to create single-use MapGeneratorState objects. Must be mutable, should implement parameter range validation in property setters, and implement ICloneable, and pass a COPY to MapGeneratorState.
Inheritance: ICloneable
Afficher le fichier Open project: fragmer/fCraft Class Usage Examples

Private Properties

Свойство Type Description
ListProperties IEnumerable

Méthodes publiques

Méthode Description
Clone ( ) : object
CreateGenerator ( ) : MapGeneratorState

Creates MapGeneratorState to create a map with the current parameters and specified dimensions. Does NOT start the generation process yet -- that should be done in MapGeneratorState.Generate()

LoadProperties ( [ baseElement ) : void

Loads generation parameters from XML. All read-write public properties, except those with [XmlIgnore] attribute, are considered. If no corresponding XML element exists, property value is unchanged.

Save ( [ baseElement ) : void

Saves current generation parameters to XML, in a format that's expected to be readable by MapGenerator.CreateParameters(XElement)

ToString ( ) : string

Private Methods

Méthode Description
ListProperties ( ) : IEnumerable

Method Details

Clone() public méthode

public Clone ( ) : object
Résultat object

CreateGenerator() public abstract méthode

Creates MapGeneratorState to create a map with the current parameters and specified dimensions. Does NOT start the generation process yet -- that should be done in MapGeneratorState.Generate()
public abstract CreateGenerator ( ) : MapGeneratorState
Résultat MapGeneratorState

LoadProperties() public méthode

Loads generation parameters from XML. All read-write public properties, except those with [XmlIgnore] attribute, are considered. If no corresponding XML element exists, property value is unchanged.
public LoadProperties ( [ baseElement ) : void
baseElement [ Element from which parameters are read. /// Each property corresponds to a child element.
Résultat void

Save() public méthode

Saves current generation parameters to XML, in a format that's expected to be readable by MapGenerator.CreateParameters(XElement)
public Save ( [ baseElement ) : void
baseElement [ Element onto which the parameters should be attached. /// Each property will correspond to a child element.
Résultat void

ToString() public méthode

public ToString ( ) : string
Résultat string