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.
Mostra file Open project: Cedric-Paris/PuzzleGameProject Class Usage Examples

Public Methods

Method 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

Method 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 method

Gets the list of the levels names.
public static GetLevels ( ) : List
return List

LoadTileMap() public static method

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.
return int>.Dictionary

Save() public static method

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

SaveTileMap() public static method

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