ReserveGoreID() static private method

static private ReserveGoreID ( ) : int
return int
Ejemplo n.º 1
0
        public void AddGore(string texture, ModGore modGore = null)
        {
            int id = ModGore.ReserveGoreID();

            ModGore.gores[texture] = id;
            if (modGore != null)
            {
                ModGore.modGores[id] = modGore;
            }
        }
Ejemplo n.º 2
0
        public void AddGore(string name, ModGore gore, string texture)
        {
            int id = ModGore.ReserveGoreID();

            gore.Name         = name;
            gore.Type         = id;
            gores[name]       = gore;
            ModGore.gores[id] = gore;
            gore.texture      = texture;
            gore.mod          = this;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Adds the given texture to the game as a custom gore, with the given custom gore behavior. If no custom gore behavior is provided, the custom gore will have the default vanilla behavior.
        /// </summary>
        /// <param name="texture">The texture.</param>
        /// <param name="modGore">The mod gore.</param>
        public void AddGore(string texture, ModGore modGore = null)
        {
            if (!loading)
            {
                throw new Exception("AddGore can only be called from Mod.Load or Mod.Autoload");
            }

            int id = ModGore.ReserveGoreID();

            ModGore.gores[texture] = id;
            if (modGore != null)
            {
                ModGore.modGores[id] = modGore;
                ContentInstance.Register(modGore);
            }
        }