-
-
Save ScottLilly/5306227a2128e0e84903 to your computer and use it in GitHub Desktop.
Lesson 09.1 - Using your classes as datatypes
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 Location | |
{ | |
public int ID { get; set; } | |
public string Name { get; set; } | |
public string Description { get; set; } | |
public Item ItemRequiredToEnter { get; set; } | |
public Quest QuestAvailableHere { get; set; } | |
public Monster MonsterLivingHere { get; set; } | |
public Location LocationToNorth { get; set; } | |
public Location LocationToEast { get; set; } | |
public Location LocationToSouth { get; set; } | |
public Location LocationToWest { get; set; } | |
public Location(int id, string name, string description, | |
Item itemRequiredToEnter = null, Quest questAvailableHere = null, Monster monsterLivingHere = null) | |
{ | |
ID = id; | |
Name = name; | |
Description = description; | |
ItemRequiredToEnter = itemRequiredToEnter; | |
QuestAvailableHere = questAvailableHere; | |
MonsterLivingHere = monsterLivingHere; | |
} | |
} | |
} |
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 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; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment