protected Gem(int strength, int agility, int vitality, IClarity clarity) { this.strength = strength; this.agility = agility; this.vitality = vitality; this.Clarity = clarity; }
protected Gem(IClarity clarity, int strength, int agility, int vitality) { this.clarity = clarity; this.Strength = strength + this.clarity.StatIncrease; this.Agility = agility + this.clarity.StatIncrease; this.Vitality = vitality + this.clarity.StatIncrease; }
public override void Execute(string[] args) { string weaponName = args[0]; int socketIndex = int.Parse(args[1]); string[] gemType = args[2].Split(); IClarity clarity = clarityFactory.Create(gemType[0]); IGem gem = gemFactory.Create(clarity, gemType[1]); Weapons[weaponName].AddGem(socketIndex, gem); }
public IGem CreateGem(string typeAsString, IClarity clarity) { var type = Assembly .GetExecutingAssembly() .GetTypes() .Where(t => t.Name == typeAsString) .First(); var instance = (IGem)Activator.CreateInstance(type, new object[] { clarity }); return(instance); }
public IGem Create(IClarity clarity, string typeName) { Type type = FactoriesUtility.GetType(typeName + "Gem"); if (!typeof(IGem).IsAssignableFrom(type)) { throw new ArgumentException(); } IGem gem = (IGem)Activator.CreateInstance(type, new object[] { clarity }); return(gem); }
public IClarity Create(string typeName) { Type type = FactoriesUtility.GetType(typeName + "Clarity"); if (!typeof(IClarity).IsAssignableFrom(type)) { throw new ArgumentException(); } IClarity clarity = (IClarity)Activator.CreateInstance(type); return(clarity); }
public Ruby(IClarity clarity) : base(rubyStrength, rubyAgility, rubyVitality, clarity) { }
public Amethyst(IClarity clarity) : base(amethystStrength, amethystAgility, amethystVitality, clarity) { }
public Emerald(IClarity clarity) : base(emeraldStrength, emeraldAgility, emeraldVitality, clarity) { }