C# Class LevelSave, PuzzleGameProject

Contains all the methods to save and load all of the elements of a level, the elements contained in the TileMap.
Afficher le fichier Open project: Cedric-Paris/PuzzleGameProject Class Usage Examples

Méthodes publiques

Méthode Description
GetLevels ( ) : List

Gets the list of the levels names.

LoadTileMap ( string fileName ) : int>.Dictionary

Read a level in a file and create the elements in it with the SquareInstanciation méthode

Save ( object entity, string fileName ) : void

Save the specified entity in a file created with the fileName passed in argument.

SaveTileMap ( string fileName, int>.Dictionary items ) : void

Saves in a file the tile map of the scene using the serializable object TileMapSave.

Private Methods

Méthode Description
LevelSave ( ) : System

Static constructor is called at most one time, before any instance constructor is invoked or member is accessed. Checks if the saves directory exists, creates it if not.

Load ( string fileName ) : object

Load the file at the specified fileName.

SquareInstanciation ( string>.KeyValuePair square, GameObject parent ) : void

Instanciate the square passed in argument, and the element in the square if there's one.

Method Details

GetLevels() public static méthode

Gets the list of the levels names.
public static GetLevels ( ) : List
Résultat List

LoadTileMap() public static méthode

Read a level in a file and create the elements in it with the SquareInstanciation méthode
public static LoadTileMap ( string fileName ) : int>.Dictionary
fileName string File name.
Résultat int>.Dictionary

Save() public static méthode

Save the specified entity in a file created with the fileName passed in argument.
public static Save ( object entity, string fileName ) : void
entity object Entity, must be serializable.
fileName string File name.
Résultat void

SaveTileMap() public static méthode

Saves in a file the tile map of the scene using the serializable object TileMapSave.
public static SaveTileMap ( string fileName, int>.Dictionary items ) : void
fileName string Name of the file where the level will be save.
items int>.Dictionary Items that are availables in the level
Résultat void