C# Класс LevelSave, PuzzleGameProject

Contains all the methods to save and load all of the elements of a level, the elements contained in the TileMap.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

GetLevels() публичный статический Метод

Gets the list of the levels names.
public static GetLevels ( ) : List
Результат List

LoadTileMap() публичный статический Метод

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.
Результат int>.Dictionary

Save() публичный статический Метод

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.
Результат void

SaveTileMap() публичный статический Метод

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
Результат void