Lesson 10.1 - Creating collections of objects - PART A - New classes
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 InventoryItem | |
{ | |
public Item Details { get; set; } | |
public int Quantity { get; set; } | |
public InventoryItem(Item details, int quantity) | |
{ | |
Details = details; | |
Quantity = quantity; | |
} | |
} | |
} |
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 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; | |
} | |
} | |
} |
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 PlayerQuest | |
{ | |
public Quest Details { get; set; } | |
public bool IsCompleted { get; set; } | |
public PlayerQuest(Quest details) | |
{ | |
Details = details; | |
IsCompleted = false; | |
} | |
} | |
} |
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 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