-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathSampleLauncher.cs
38 lines (34 loc) · 869 Bytes
/
SampleLauncher.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
32
33
34
35
36
37
38
using System;
using FactoryMethod.Impl;
using FactoryMethod.Abstract;
using FactoryMethod.Entities.Enums;
namespace FactoryMethod
{
class SampleLauncher
{
static void Main(string[] args)
{
foreach(Profession profession in Enum.GetValues(typeof(Profession)))
{
DisplaySkills(profession);
}
Console.WriteLine("Please enter any key to exit...");
Console.ReadKey();
}
/// <summary>
/// Displays employee's skills.
/// </summary>
/// <param name="profession">The employee's profession.</param>
static void DisplaySkills(Profession profession)
{
Employee employee = LaborExchange.GetEmployee(profession);
if (employee == null)
{
Console.WriteLine("The labor exchange cannot provide any {0}s\n", profession);
return;
}
Console.WriteLine("Profession: {0}", profession);
employee.DisplaySkills();
}
}
}