public Resource(string nameText, VColor nameForeground, int size = 1) { NameText = nameText; NameForeground = nameForeground; Size = size; AllResources.Add(this); }
private static void AddLanguage(PropertyInfo[] keys, ResourceManager resourceManager, string languageName, string cultureName) { if (!AllResources.ContainsKey(languageName) && !string.IsNullOrWhiteSpace(languageName)) { AllResources.Add(languageName, keys.ToDictionary( key => key.Name, key => resourceManager.GetString( key.Name, new CultureInfo(cultureName)))); } }
public void Setup() { string[] gunnames = new string[] { "Excalibur", "Glock", "Assualt Rifle" , "Red John", "Heaven Bringer", "Glory", "Lucy" }; string[] swordnames = new string[] { "Champion", "Wooden sword", "Stormbringer" , "Mournblade", "Sword of Dawn", "RavenBrand", "Harry" }; string[] armournames = new string[] { "Hide Armour", "Iron Armour", "Elestial Armour" , "Windbreaker", "A Sheet", "A leaf", "Diamond Glades" }; // be mindfull of the size of the arrays, as they need to be equal length if (gunnames.Length - swordnames.Length != 0) { throw new ArgumentOutOfRangeException(); } if (gunnames.Length - armournames.Length != 0) { throw new ArgumentOutOfRangeException(); } ItemFactory fact = new ItemFactory(); for (int i = 0; i < gunnames.Length; i++) { //var gun = fact.CreateItem<Gun>(); //allItems.Add(gunnames[i], gun); //allItems[gunnames[i]].Name = gunnames[i]; ////AllItems.Add(gun); //var sword = fact.CreateItem<Sword>(); //allItems.Add(swordnames[i], sword); //allItems[swordnames[i]].Name = swordnames[i]; ////AllItems.Add(sword); //var armour = fact.CreateItem<Clothing>(); //allItems.Add(armournames[i], armour); //allItems[armournames[i]].Name = armournames[i]; ////AllItems.Add(armour); Item gun = new Gun(gunnames[i]); AllItems.Add(gun.Name, gun); Item sword = new Sword(swordnames[i]); AllItems.Add(sword.Name, sword); Item armour = new Clothing(armournames[i]); AllItems.Add(armour.Name, armour); } //var fist = fact.CreateItem<Sword>(); Item fist = new Weapon("Fist"); AllItems.Add("Fist", fist); Player.MakeItem(AllItems["Fist"]); Player.EquipItem(AllItems["Fist"]); Player.EquipItem(AllItems["Hide Armour"]); Console.WriteLine(Player.EquipedWeapon.ToString()); AllResources.Add(new Resource("Wood")); // for home / defence AllResources.Add(new Resource("Iron")); // make weapons / clothes AllResources.Add(new Resource("Grain")); // for the citizens AllResources.Add(new Resource("Wool")); // for clothes AllResources.Add(new Resource("Stone")); // for home / defence string[] enemyList = { "Rebelious Farmer", "Giant Wolf", "Lost Knight", "Sneaky Ninja", "Slow Oger", "Swift Reeves", "Mad Scientist" }; for (int i = 0; i < enemyList.Length; i++) { int damageRandom = rand.Next(1, 51); Enemys.Add(new Enemy(enemyList[i], damageRandom)); } GenerateMap(); }