Ejemplo n.º 1
0
        }                                                                                                                                                       // concealed inside a function called GetTerrainRecords()

        // that returns an McdRecordCollection that's why.
        /// <summary>
        /// Gets the count of MCD-records in an MCD-file.
        /// </summary>
        /// <param name="id">the position of the terrain in this tileset's terrains-list</param>
        /// <param name="suppressError">true to suppress any error</param>
        /// <returns>count of MCD-records or 0 on fail</returns>
        public int GetRecordCount(int id, bool suppressError = false)
        {
            var    terrain = Terrains[id];
            string terr    = terrain.Item1;
            string path    = terrain.Item2;

            path = GetTerrainDirectory(path);

            return(TilepartFactory.GetRecordCount(terr, path, suppressError));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the MCD-records for a given terrain in this Descriptor.
        /// </summary>
        /// <param name="id">the position of the terrain in this tileset's terrains-list</param>
        /// <returns>an McdRecordCollection containing all the parts for the Terrain</returns>
        public McdRecordCollection GetTerrainRecords(int id)
        {
            var    terrain = Terrains[id];
            string terr    = terrain.Item1;
            string path    = terrain.Item2;

            path = GetTerrainDirectory(path);

            var tiles = TilepartFactory.CreateTileparts(
                terr, path,
                ResourceInfo.LoadSpriteset(terr, path, 2, Pal));                                                                                                // NOTE: That loads the sprites in addition to

            return(new McdRecordCollection(tiles));                                                                                                             // getting the MCD-records. here just because it can be
        }                                                                                                                                                       // concealed inside a function called GetTerrainRecords()