I'm trying to create some easily accessible database of different skills. General idea is that every skill should do something different and be able to act on different things (ex. one skill which icreases weapon attack by 'x' [it acts on weapon] and other one which icreases chances to drop item by 'z'% [it acts on monster]).I see it that way:There is static database of skills accessible from everywhereSkills have effects(methods with different return types, different parameters and calculations)To use skill we add it's effect in particular calculations;Example: If we want to increase drop chance of monster by 'z'% then, in place where we calculate that drop chance (in this case in Monster class), lets say (Monster.DropChance = 0.5f) we add skill effect : after skill implementation (Monster.DropChance = 0.5f + SkillDatabase.IncreaseDropChance.Effect (this))I came up with a code like this:public static class SkillData   // Static class acting as database for keeping skills in one place{    // Names of skills    public enum Name    {        IncreaseDropChance = 1,        IncreaseWeaponAtk = 2    }       // T - return type of skill effect, U - type of object on which effect works    public class Skill<T, U>    {        public int Level { get; set; }        public float ExperienceCost { get; set; }        public Name SName;        // Delegate for creating unique effects for each skill        public delegate T EffectDel (U onWhat);        public EffectDel Effect;         public Skill (Name name)        {            SName = name;        }    }    // Custom dictionary for generic skill    public class SkillDictionary    {        private Dictionary<Name, object> _dict = new Dictionary<Name, object>();        public void Add<T, U>(Name key, Skill<T, U> skill)        {            _dict.Add(key, skill);        }        public Skill<T, U> GetValue<T, U>(Name key)        {            return _dict[key] as Skill<T,U>;        }    }    // Static for easy access    public static SkillDictionary DB = new SkillDictionary ();    static SkillData ()    {        // Here I want to create skills one after another and add them to DB        // This is example skill creation        Skill <float, Player> IncrWpnAtk = new Skill<float, Player> (SName.IncreaseWeaponAtk);        IncrWpnAtk.Level = 5;        // Let's say we want to increase weapon attack by 100% * skillLvl        IncrWpnAtk.Effect = (player) => { float additionalAtk = player.Eq.Weapon.Atk * IncrWpnAtk.Level;                                           return additionalAtk; };        DB.Add <float, Player> (Name.IncreaseWeaponAtk, IncrWpnAtk);    }}Now in weapon attack calculation we add SkillData.DB.GetValue<float, Player> (IncreaseWeaponAtk).Effect (player) .Yeah... It's terrible. Load of text for such a tiny effect. It's my second time using delegates and third time creating generic classes, I just don't know any other solution for creating same class with different methods. How would you solve it guys? Do you know any way to maintain organized, easily accessible database of skills? Or maby this approach is generaly wrong?
Game passive skill system
c#;game;generics;dictionary;delegates