-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
31 lines (24 loc) · 995 Bytes
/
Program.cs
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
using System;
using Instrumets;
using Store;
namespace Guitar
{
class Prgram
{
static void Main(string[] args)
{
Console.WriteLine("Start");
Inventory inventory = new Inventory();
inventory.AddGuitar("serial1", 100, Builder.FENDER, "fender", GuitarType.ACOUSTIC, Wood.SITKA, Wood.ADRONDACK, 6);
inventory.AddGuitar("serial2", 100, Builder.FENDER, "stratocaster", GuitarType.ACOUSTIC, Wood.SITKA, Wood.ADRONDACK, 6);
inventory.AddGuitar("serial3", 100, Builder.FENDER, "he", GuitarType.ACOUSTIC, Wood.SITKA, Wood.ADRONDACK, 6);
GuitarInstrument? guitar = inventory.GetGuitar("serial");
Console.WriteLine(guitar?.Spec.Builder ?? null);
List<GuitarInstrument> search = inventory.Search(new GuitarSpec(Builder.FENDER, "Fender", GuitarType.ACOUSTIC, Wood.SITKA, Wood.ADRONDACK, 6));
foreach (GuitarInstrument g in search)
{
Console.WriteLine(g.Spec.Builder);
}
}
}
}