public Weapon(string name, RarityLevel rarityLevel, int minDamageInitialValue, int maxDamageInitialValue, int socketInitialNumber) { this.Name = name; this.BaseStat = new BaseStatus(minDamageInitialValue, maxDamageInitialValue, socketInitialNumber, rarityLevel); this.MagicalStat = new MagicalStatus(); this.RarityLevel = rarityLevel; }
public Weapon(RarityLevel rarity, string name, int baseMinDamage, int baseMaxDamage, int numberOfSockets) { this.Rarity = rarity; this.Name = name; this.BaseMinDamage = baseMinDamage; this.BaseMaxDamage = baseMaxDamage; this.gems = new Gem[numberOfSockets]; }
public Weapon(RarityLevel rarityLevel, string name, int defaultMinDamage, int defaultMaxDamage) { this.Name = name; this.RarityLevel = rarityLevel; this.Sockets = new IGem[socketsCount]; this.defaultMinDamage = defaultMinDamage; this.defaultMaxDamage = defaultMaxDamage; }
public override void Execute() { var split = this.Data[0].ToString().Split(); var type = split[1]; RarityLevel rarityLevel = (RarityLevel)Enum.Parse(typeof(RarityLevel), split[0]); string name = this.Data[1].ToString(); var weapon = this.WeaponFactory.CreateWeapon(type, name, rarityLevel); this.Repository.AddWeapon(weapon); }
public IWeapon Create(string[] data) { string[] weaponInfo = data[1].Split(); RarityLevel rarityLevel = Enum.Parse <RarityLevel>(weaponInfo[0]); var weaponType = Assembly.GetCallingAssembly().GetTypes().FirstOrDefault(x => x.Name == weaponInfo[1]); string weaponName = data[2]; var instance = (IWeapon)Activator.CreateInstance(weaponType, new object[] { rarityLevel, weaponName }); return(instance); }
protected Weapon(string name, RarityLevel rarityLevel) { this.RarityLevel = rarityLevel; this.Strenght = 0; this.Agility = 0; this.Vitality = 0; this.Gems = new Gem[NumberOfSockets]; this.MinDamage = 0; this.MaxDamage = 0; this.Name = name; }
public IWeapon CreateCommand(string[] data) { string[] weaponData = data[1].Split(); string rarityAsString = weaponData[0]; RarityLevel rarity = (RarityLevel)Enum.Parse(typeof(RarityLevel), rarityAsString); string weaponType = weaponData[1]; string name = data[2]; Type classType = Type.GetType("_07InfernoInfinity.Models.Weapons." + weaponType); var weaponInstance = (IWeapon)Activator.CreateInstance(classType, new object[] { rarity, name }); return(weaponInstance); }
public static string WriteRarityLevelDictionary() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Rarity Level Dictionary"); sb.AppendLine("-------------------------"); foreach (var item in rarityDictionary) { RarityLevel rare = item.Key; sb.AppendLine(string.Format("<color={0}>{1}</Color>", GetColor(rare), rare)); } sb.AppendLine("-------------------------"); return(sb.ToString()); }
protected Weapon( string name, int minDamage, int maxDamage, int socketsCount, RarityLevel rarityLevel) { this.Name = name; this.MinDamage = minDamage; this.MaxDamage = maxDamage; this.SocketsCount = socketsCount; this.RarityLevel = rarityLevel; this.gems = (IGem[])Array.CreateInstance(typeof(Gem), this.SocketsCount); }
public IWeapon CreateWeapon(string type, string name, RarityLevel rarityLevel) { Assembly assembly = Assembly.GetExecutingAssembly(); var model = assembly.GetTypes().FirstOrDefault(x => x.Name == type); if (model == null) { throw new ArgumentException("Invalid type!"); } if (!typeof(IWeapon).IsAssignableFrom(model)) { throw new ArgumentException(model + " is not Weapon type!"); } return((IWeapon)Activator.CreateInstance(model, new object[] { name, rarityLevel })); }
public Axe(string name, RarityLevel rarityLevel) : base(name, AxeMinDamage, AxeMaxDamage, AxeSocketsCount, rarityLevel) { }
public Axe(string name, RarityLevel rarity) : base(name, minDamage, maxDamage, countOfSockets, rarity) { }
protected Weapon(string name, int minDemage, int maxDemage, int countOfSockets, RarityLevel rarity) { this.Name = name; this.Rarity = rarity; this.MinDemage = minDemage; this.MaxDemage = maxDemage; this.sockets = new Gem[countOfSockets]; }
public Sword(string name, RarityLevel rarityLevel) : base(name, SwordMinDamage, SwordMaxDamage, SwordSocketsCount, rarityLevel) { }
public Axe(string name, RarityLevel rarityLevel) : base(BASE_MIN_DMG, BASE_MAX_DMG, BASE_SOCKET_NUMBER, name, rarityLevel) { }
public Knife(string name, RarityLevel rarityLevel) : base(name, KnifeMinDamage, KnifeMaxDamage, KnifeSocketsCount, rarityLevel) { }
public static string GetColor(RarityLevel rarity) { return(rarityDictionary.First(T => T.Key == rarity).Value.First(T => T.Key == RarityAttribute.color).Value.ToString()); }
public Sword(RarityLevel rarity, string name) : base(rarity, name, 4, 6, 3) { }
public Knife(RarityLevel rarity, string name) : base(rarity, name, 3, 4, 2) { }
public Sword(string name, RarityLevel rarityLevel) : base(name, rarityLevel, minDamageInitialValue, maxDamageInitialValue, socketInitialNumber) { }
public Axe(RarityLevel rarity, string name) : base(rarity, name, 5, 10, 4) { }
public Sword(string name, RarityLevel rarityLevel) : base(name, rarityLevel) { }
public Knife(RarityLevel rarityLevel, string name) : base(rarityLevel, name, defaultMinDamage, defaultMaxDamage) { this.Sockets = new IGem[socketsCount]; }
public Knife(string name, RarityLevel rarity) : base(name, minDemage, maxDemage, countOfSockets, rarity) { }
protected Weapon(int baseMinDmg, int baseMaxDmg, int socketNumber, string name, RarityLevel rarityLevel) { this.Name = name; this.BaseMinDmg = baseMinDmg; this.BaseMaxDmg = baseMaxDmg; this.RarityLevel = rarityLevel; SetDmg(); this.Gems = new IGem[socketNumber]; }
public Axe(string name, RarityLevel rarityLevel) : base(name, rarityLevel) { }
public BaseStatus(int minDamage, int maxDamage, int sockets, RarityLevel rarityLevel) { this.MinDamage = minDamage * (int)rarityLevel; this.MaxDamage = maxDamage * (int)rarityLevel; this.Sockets = new IGem[sockets]; }