public class Player { public string Name { get; set; } public List Inventory { get; set; } public int MaxHealth { get; set; } public int CurrentHealth { get; set; } public int MaxMPoints { get; set; } public int CurrentMPoints { get; set; } public Player(string name, List inventory, int maxhealth, int currenthealth, int maxmpoints, int currentmpoints) { Name = name; Inventory = inventory; MaxHealth = maxhealth; CurrentHealth = currenthealth; MaxMPoints = maxmpoints; CurrentMPoints = currentmpoints; } //Returns the players inventory in a Dictionary. public Dictionary RetrieveInventory() { return Inventory .GroupBy(item => item.Name) .ToDictionary(group => group.Key, group => group.Count()); } //For using a healing item. Doesn't allow you to overheal. public void UseHealingItem(HealingItem item) { if ((CurrentHealth + item.HealingAmount) > MaxHealth) { CurrentHealth = MaxHealth; } else { CurrentHealth += item.HealingAmount; } } }