Repository navigation
Expand file tree
/
Copy pathProgram.cs
More file actions
54 lines (49 loc) · 1.96 KB
/
Copy pathProgram.cs
File metadata and controls
54 lines (49 loc) · 1.96 KB
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
44
45
46
47
48
49
50
51
52
53
54
namespace Game
{
class Program
{
static void Main()
{
Controller.StartGame();
var mediator = new Mediator();
foreach (var evt in BullFight.Begin(mediator))
{
switch (evt)
{
case Events.MatchStarted matchStarted:
View.ShowStartingConditions(matchStarted);
break;
case Events.BullCharging bullCharging:
View.ShowStartOfPass(bullCharging.PassNumber);
var (action, riskLevel) = Controller.GetPlayerIntention(bullCharging.PassNumber);
switch (action)
{
case Action.Dodge:
mediator.Dodge(riskLevel);
break;
case Action.Kill:
mediator.Kill(riskLevel);
break;
case Action.Panic:
mediator.Panic();
break;
}
break;
case Events.PlayerGored playerGored:
View.ShowPlayerGored(playerGored.Panicked, playerGored.FirstGoring);
break;
case Events.PlayerSurvived:
View.ShowPlayerSurvives();
if (Controller.GetPlayerRunsFromRing())
mediator.RunFromRing();
else
mediator.ContinueFighting();
break;
case Events.MatchCompleted matchCompleted:
View.ShowFinalResult(matchCompleted.Result, matchCompleted.ExtremeBravery, matchCompleted.Reward);
break;
}
}
}
}
}