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
Datei anzeigen Open project: fragmer/fCraft Class Usage Examples

Private Properties

Property Type Description
ListProperties IEnumerable

Public Methods

Method 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

Method Description
ListProperties ( ) : IEnumerable

Method Details

Clone() public method

public Clone ( ) : object
return object

CreateGenerator() public abstract method

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
return MapGeneratorState

LoadProperties() public method

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.
return void

Save() public method

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.
return void

ToString() public method

public ToString ( ) : string
return string