ReserveBuffID() static private method

static private ReserveBuffID ( ) : int
return int
Ejemplo n.º 1
0
        protected override sealed void Register()
        {
            ModTypeLookup <ModBuff> .Register(this);

            Type        = BuffLoader.ReserveBuffID();
            DisplayName = Mod.GetOrCreateTranslation($"Mods.{Mod.Name}.BuffName.{Name}");
            Description = Mod.GetOrCreateTranslation($"Mods.{Mod.Name}.BuffDescription.{Name}");

            BuffLoader.buffs.Add(this);
        }
Ejemplo n.º 2
0
        public void AddBuff(string name, ModBuff buff, string texture)
        {
            int id = BuffLoader.ReserveBuffID();

            buff.Name            = name;
            buff.Type            = id;
            buffs[name]          = buff;
            BuffLoader.buffs[id] = buff;
            buff.texture         = texture;
            buff.mod             = this;
        }