-
-
Save ScottLilly/582dc1e93794d4d3c48e to your computer and use it in GitHub Desktop.
Lesson 10.1 - Creating collections of objects - PART B - Changes to existing classes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Engine | |
{ | |
public class Monster : LivingCreature | |
{ | |
public int ID { get; set; } | |
public string Name { get; set; } | |
public int MaximumDamage { get; set; } | |
public int RewardExperiencePoints { get; set; } | |
public int RewardGold { get; set; } | |
public List<LootItem> LootTable { get; set; } | |
public Monster(int id, string name, int maximumDamage, int rewardExperiencePoints, int rewardGold, int currentHitPoints, int maximumHitPoints) | |
: base(currentHitPoints, maximumHitPoints) | |
{ | |
ID = id; | |
Name = name; | |
MaximumDamage = maximumDamage; | |
RewardExperiencePoints = rewardExperiencePoints; | |
RewardGold = rewardGold; | |
LootTable = new List<LootItem>(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Engine | |
{ | |
public class Player : LivingCreature | |
{ | |
public int Gold { get; set; } | |
public int ExperiencePoints { get; set; } | |
public int Level { get; set; } | |
public List<InventoryItem> Inventory { get; set; } | |
public List<PlayerQuest> Quests { get; set; } | |
public Player(int currentHitPoints, int maximumHitPoints, int gold, int experiencePoints, int level) : base(currentHitPoints, maximumHitPoints) | |
{ | |
Gold = gold; | |
ExperiencePoints = experiencePoints; | |
Level = level; | |
Inventory = new List<InventoryItem>(); | |
Quests = new List<PlayerQuest>(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Engine | |
{ | |
public class Quest | |
{ | |
public int ID { get; set; } | |
public string Name { get; set; } | |
public string Description { get; set; } | |
public int RewardExperiencePoints { get; set; } | |
public int RewardGold { get; set; } | |
public List<QuestCompletionItem> QuestCompletionItems { get; set; } | |
public Item RewardItem { get; set; } | |
public Quest(int id, string name, string description, int rewardExperiencePoints, int rewardGold) | |
{ | |
ID = id; | |
Name = name; | |
Description = description; | |
RewardExperiencePoints = rewardExperiencePoints; | |
RewardGold = rewardGold; | |
QuestCompletionItems = new List<QuestCompletionItem>(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment