public Monster(string name, WarriorStats stats, int xpreward, int goldreward, System.Drawing.Image picture) { this.Name = name; this.stats = stats; this.xpreward = xpreward; this.goldreward = goldreward; this.picture = picture; }
public Player(string name, WarriorStats stats, List<Item> inventory, Weapon weapon, Armour armour) { this.Name = name; this.stats = stats; this.inventory = inventory; this.equippedweapon = weapon; this.equippedarmour = armour; }
public Player StartGame(string name) { List<Item> inventory = new List<Item>(); inventory.Add(getItem(7)); Weapon weapon = (Weapon)getItem(-1); Armour armour = (Armour)getItem(-2); WarriorStats playerStats = new WarriorStats() { Accuracy = 80, MaxHp = 10, Hp = 10, Level = 1, Strength = 3, Speed = 7 }; Player player = new Player(name, playerStats, inventory, weapon, armour) { Gold = 1001 }; GameInProgress = true; return player; }
public Player(SerializationInfo info, StreamingContext ctxt) { this.stats = (WarriorStats)info.GetValue("stats", typeof(WarriorStats)); this.inventory = (List<Item>)info.GetValue("inventory", typeof(List<Item>)); this.equippedweapon = (Weapon)info.GetValue("weapon", typeof(Weapon)); this.equippedarmour = (Armour)info.GetValue("armour", typeof(Armour)); this.Name = (string)info.GetValue("Name", typeof(string)); this.XP = (int)info.GetValue("XP", typeof(int)); this.Gold = (int)info.GetValue("Gold", typeof(int)); }
private Monster GetMonsterById(int monsterid) { var name = getMonsterStat(monsterid, "name"); var stats = new WarriorStats() { Level = int.Parse(getMonsterStat(monsterid, "level")), MaxHp = int.Parse(getMonsterStat(monsterid, "hp")), Hp = int.Parse(getMonsterStat(monsterid, "hp")), Accuracy = int.Parse(getMonsterStat(monsterid, "accuracy")), Strength = int.Parse(getMonsterStat(monsterid, "damage")), Speed = int.Parse(getMonsterStat(monsterid, "speed")) }; var xp = int.Parse(getMonsterStat(monsterid, "xp")); var gold = int.Parse(getMonsterStat(monsterid, "gold")); var picture = rabbit_image; return new Monster(name, stats, xp, gold, picture); }