Skip to content

Instantly share code, notes, and snippets.

@ScottLilly
Created April 19, 2014 12:45
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/9d6042780a563cabef12 to your computer and use it in GitHub Desktop.
Save ScottLilly/9d6042780a563cabef12 to your computer and use it in GitHub Desktop.
Lesson 08.1 - Setting properties with a class constructor
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 Location(int id, string name, string description)
{
ID = id;
Name = name;
Description = description;
}
}
}
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 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