ProD  4.0
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | List of all members
ProD.FilePorter Class Reference

Inherits ProD.Singleton< T >.

Public Member Functions

string mapToCsvString (Map map, ref List< string > types)
 Converts a given map to a CSV string. More...
 
void saveMapToTmx (Map map, string path, string filename)
 Saves a given map int the TMX (Tile Map XML) format. By now it uses no compression and CSV encoding. Be carefull, as the "defaultProd.png" spritesheet to display the tmx in Tiled only supports 10 additional types besides the standard types Abyss, Wall, Path, Door, Entrance and Exit. Warning: may throw exceptions, occuring during filewriting! Warning: this will only work for standalone builds. (TODO: test for Mac and Linux) More...
 
Map loadMapFromTmx (string path, string filename)
 loads a TMX (Tile Map XML) file and creates a map object out of it. By now it can only handle no compression and CSV encoding. Warning: may throw exceptions, occuring during filereading parsing of the data! the latter could happen when the file is corrupted/not edited properly Warning: this will only work for standalone builds. (TODO: test for Mac and Linux) More...
 

Additional Inherited Members

- Static Protected Attributes inherited from ProD.Singleton< T >
static T instance
 
- Properties inherited from ProD.Singleton< T >
static T Instance [get]
 

Member Function Documentation

Map ProD.FilePorter.loadMapFromTmx ( string  path,
string  filename 
)

loads a TMX (Tile Map XML) file and creates a map object out of it. By now it can only handle no compression and CSV encoding. Warning: may throw exceptions, occuring during filereading parsing of the data! the latter could happen when the file is corrupted/not edited properly Warning: this will only work for standalone builds. (TODO: test for Mac and Linux)

Returns
The map.
Parameters
pathThe path from where the file should be loaded. Make sure that the last character is a slash!
filenameThe name of the TMX file without extension.
string ProD.FilePorter.mapToCsvString ( Map  map,
ref List< string >  types 
)

Converts a given map to a CSV string.

Returns
The map as a single string.
Parameters
mapThe specific map you want to be converted.
typesThe list of types. The indices of the types are used as values in the CSV string. Every new found type in the map is added to the list.
void ProD.FilePorter.saveMapToTmx ( Map  map,
string  path,
string  filename 
)

Saves a given map int the TMX (Tile Map XML) format. By now it uses no compression and CSV encoding. Be carefull, as the "defaultProd.png" spritesheet to display the tmx in Tiled only supports 10 additional types besides the standard types Abyss, Wall, Path, Door, Entrance and Exit. Warning: may throw exceptions, occuring during filewriting! Warning: this will only work for standalone builds. (TODO: test for Mac and Linux)

Parameters
mapThe map you want to be saved.
pathThe path where the file should be saved. Make sure that the last character is a slash! When trying to open the file with an editor (for example "Tiled") make shure that the spritesheet "defaultProd.png" resides in the same folder
filenameThe name of the TMX file without extension.