ReserveBuffID() static private method

static private ReserveBuffID ( ) : int
return int
Beispiel #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);
        }
Beispiel #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;
        }