-
Notifications
You must be signed in to change notification settings - Fork 2
/
Solved.cs
43 lines (38 loc) · 1.24 KB
/
Solved.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
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Linq;
using lib.Models;
using lib.Models.Actions;
namespace lib.Solvers
{
public class Solved
{
public List<BoosterType> Buy { get; set; }
public List<List<ActionBase>> Actions { get; set; }
public string FormatSolution() => Actions.Format();
public string FormatBuy() => Buy?.Format();
public int CalculateTime() => Actions.CalculateTime();
public int BuyCost()
{
return Buy?.Sum(
b =>
{
switch (b)
{
case BoosterType.Extension:
return 1000;
case BoosterType.Drill:
return 700;
case BoosterType.FastWheels:
return 300;
case BoosterType.Teleport:
return 1200;
case BoosterType.Cloning:
return 2000;
default:
throw new ArgumentOutOfRangeException(nameof(b), b, null);
}
}) ?? 0;
}
}
}