Skip to content

Instantly share code, notes, and snippets.

@ScottLilly
Last active November 25, 2015 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ScottLilly/582dc1e93794d4d3c48e to your computer and use it in GitHub Desktop.
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
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>();
}
}
}
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>();
}
}
}
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