11var Formats = require ( '../Formats' ) ;
22var Parse2DArray = require ( './Parse2DArray' ) ;
33var ParseCSV = require ( './ParseCSV' ) ;
4- var ParseTiledJSON = require ( './tiled/' ) ;
5- var ParseWeltmister = require ( './impact/' ) ;
4+ var ParseJSONTiled = require ( './tiled/ParseJSONTiled ' ) ;
5+ var ParseWeltmeister = require ( './impact/ParseWeltmeister ' ) ;
66
77/**
88 * Parses raw data of a given Tilemap format into a new MapData object. If no recognized data format
99 * is found, returns `null`. When loading from CSV or a 2D array, you should specify the tileWidth &
1010 * tileHeight. When parsing from a map from Tiled, the tileWidth & tileHeight will be pulled from
1111 * the map data.
1212 *
13+ * @function Phaser.Tilemaps.Parsers.Parse
14+ * @since 3.0.0
15+ *
1316 * @param {string } name - The name of the tilemap, used to set the name on the MapData.
1417 * @param {integer } mapFormat - See ../Formats.js.
1518 * @param {integer[][]|string|object } data - 2D array, CSV string or Tiled JSON object.
@@ -23,12 +26,14 @@ var ParseWeltmister = require('./impact/');
2326 * the tile data doesn't need to change then setting this value to `true` will help with memory
2427 * consumption. However if your map is small or you need to update the tiles dynamically, then leave
2528 * the default value set.
29+ *
30+ * @return {[type] } [description]
2631 */
2732var Parse = function ( name , mapFormat , data , tileWidth , tileHeight , insertNull )
2833{
2934 var newMap ;
3035
31- switch ( mapFormat )
36+ switch ( mapFormat )
3237 {
3338 case ( Formats . ARRAY_2D ) :
3439 newMap = Parse2DArray ( name , data , tileWidth , tileHeight , insertNull ) ;
@@ -37,10 +42,10 @@ var Parse = function (name, mapFormat, data, tileWidth, tileHeight, insertNull)
3742 newMap = ParseCSV ( name , data , tileWidth , tileHeight , insertNull ) ;
3843 break ;
3944 case ( Formats . TILED_JSON ) :
40- newMap = ParseTiledJSON ( name , data , insertNull ) ;
45+ newMap = ParseJSONTiled ( name , data , insertNull ) ;
4146 break ;
4247 case ( Formats . WELTMEISTER ) :
43- newMap = ParseWeltmister ( name , data , insertNull ) ;
48+ newMap = ParseWeltmeister ( name , data , insertNull ) ;
4449 break ;
4550 default :
4651 console . warn ( 'Unrecognized tilemap data format: ' + mapFormat ) ;
0 commit comments