49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
using System.Text;
|
|
using SantaClausInc.Core;
|
|
|
|
Console.OutputEncoding = Encoding.UTF8;
|
|
|
|
Console.WriteLine("*** SantaClausInc ***");
|
|
|
|
var list = CreateList();
|
|
var sleighs = Preparation.PrepareTours(list);
|
|
|
|
for (var i = 0; i < sleighs.Count; i++)
|
|
{
|
|
var sleigh = sleighs[i];
|
|
var tourLog = sleigh!.ExecuteTour();
|
|
for (var j = 0; j < tourLog.Count; j++)
|
|
{
|
|
Console.WriteLine(tourLog[j]);
|
|
}
|
|
|
|
Console.WriteLine();
|
|
}
|
|
|
|
# region data creation
|
|
|
|
static GoodAndNaughtyList CreateList()
|
|
{
|
|
var children = CreateChildren();
|
|
|
|
return new GoodAndNaughtyList(children);
|
|
}
|
|
|
|
static List<ChildInfo> CreateChildren()
|
|
{
|
|
var list = new List<ChildInfo>();
|
|
list.Add(new ChildInfo("Sepp", 6, "Linz", 1, 1.4D));
|
|
list.Add(new ChildInfo("Lisa", 12, "Leonding", 2, 3.8D));
|
|
list.Add(new ChildInfo("Horst", 8, "Steyr", 3, 0.4D));
|
|
list.Add(new ChildInfo("Lukas", 19, "Linz", 4, -4.3D));
|
|
list.Add(new ChildInfo("Maria", 16, "Linz", 5, 2.5D));
|
|
list.Add(new ChildInfo("Sebastian", 3, "Steyr", 6, 0.9D));
|
|
list.Add(new ChildInfo("Regina", 9, "Linz", 7, -0.1D));
|
|
list.Add(new ChildInfo("Hanna", 15, "Leonding", 8, 0.9D));
|
|
list.Add(new ChildInfo("Emily", 4, "Linz", 9, 1.7D));
|
|
list.Add(new ChildInfo("Martin", 11, "Leonding", 10, 3.1D));
|
|
|
|
return list;
|
|
}
|
|
|
|
# endregion
|