Skip to content

Instantly share code, notes, and snippets.

@ScottLilly ScottLilly/Monster.cs Secret
Last active Nov 25, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.