Skip to content

Instantly share code, notes, and snippets.

@ScottLilly
Created April 20, 2014 20:47
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/161a5812ae4843563d6b to your computer and use it in GitHub Desktop.
Save ScottLilly/161a5812ae4843563d6b to your computer and use it in GitHub Desktop.
Lesson 10.1 - Creating collections of objects - PART A - New classes
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Engine
{
public class InventoryItem
{
public Item Details { get; set; }
public int Quantity { get; set; }
public InventoryItem(Item details, int quantity)
{
Details = details;
Quantity = quantity;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Engine
{
public class LootItem
{
public Item Details { get; set; }
public int DropPercentage { get; set; }
public bool IsDefaultItem { get; set; }
public LootItem(Item details, int dropPercentage, bool isDefaultItem)
{
Details = details;
DropPercentage = dropPercentage;
IsDefaultItem = isDefaultItem;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Engine
{
public class PlayerQuest
{
public Quest Details { get; set; }
public bool IsCompleted { get; set; }
public PlayerQuest(Quest details)
{
Details = details;
IsCompleted = false;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Engine
{
public class QuestCompletionItem
{
public Item Details { get; set; }
public int Quantity { get; set; }
public QuestCompletionItem(Item details, int quantity)
{
Details = details;
Quantity = quantity;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment