Exemplo n.º 1
0
 public static Tileset Load(string filename)
 {
     if (TilesetXmlLoader.TileTypes == null)
     {
         TilesetXmlLoader.LoadTypes();
     }
     return(new TilesetXmlLoader().LoadXml("", filename));
 }
Exemplo n.º 2
0
        public static Tileset[] MultiLoad(string filename, string[] levelNames)
        {
            if (TilesetXmlLoader.TileTypes == null)
            {
                TilesetXmlLoader.LoadTypes();
            }
            List <Tileset> tilesets = new List <Tileset>();

            for (int i = 0; i < levelNames.Length; i++)
            {
                tilesets.Add(new TilesetXmlLoader().LoadXml(levelNames[i], filename));
            }
            return(tilesets.ToArray());
        }
Exemplo n.º 3
0
        /// <summary>
        /// Loads the specified Ogmo Editor level from the Resources/ folder immediately, taking care
        /// of stopping audio entities, clearing the player and recreating the world from the tileset.
        /// </summary>
        /// <param name="name">The name of the Ogmo Editor level as it appears on disk, without the extension or leading path.</param>
        protected void LoadLevelImmediate(string name)
        {
            // Perform the actual level switch.
            foreach (IEntity ee in this.Entities)
            {
                if (ee is AudioEntity)
                {
                    (ee as AudioEntity).Stop();
                }
            }
            this.Entities.Clear();
            this.Tileset      = TilesetXmlLoader.Load(Path.Combine(World.BaseDirectory, "Resources/" + name + ".oel"));
            this.CurrentLevel = name;

            foreach (Tile t in this.Tileset.AsLinear())
            {
                if (t is EntityTile)
                {
                    this.Entities.Add(t as EntityTile);
                }
            }
        }
Exemplo n.º 4
0
 public TileNameAttribute(string name, TilesetXmlLoader.XmlLoadMode type)
 {
     this.Name = name;
     this.Type = type;
 }