-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
39 lines (31 loc) · 769 Bytes
/
Program.cs
File metadata and controls
39 lines (31 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using inventory_example;
using inventory_example.InventorySystem;
var swordData = new
{
id = "sword",
name = "Sword",
tags = "weapon,equip",
description = "This is a powerful sword.",
stackSize = 1,
buyValue = 100
};
var appleData = new
{
id = "apple",
name = "Apple",
tags = "usable",
description = "Nom nom.",
stackSize = 20,
buyValue = 3
};
Item sword = new(swordData);
Item apple = new(appleData);
ObjectWithInventories someGuy1 = new();
someGuy1.Backpack.Add(sword);
Console.WriteLine(someGuy1.Backpack);
someGuy1.Backpack.Add(apple);
Console.WriteLine(someGuy1.Backpack);
apple.AddQuantity(10);
Console.WriteLine(someGuy1.Backpack);
someGuy1.Backpack.Move(apple, 3);
Console.WriteLine(someGuy1.Backpack);