-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCompanyStrike.cs
47 lines (38 loc) · 986 Bytes
/
CompanyStrike.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
44
45
46
47
// CompanyStrike.cs
/*
* This class represents a labor strike against a specific player.
* The only effect is that the player loses a turn.
*
*/
using System;
using System.IO;
namespace Rails
{
public class CompanyStrike : Disaster
{
Player affected;
public CompanyStrike(int currentPlayer, Map map, Player affectedPlayer) : base(currentPlayer, map)
{
affected = affectedPlayer;
}
public override void Save(BinaryWriter writer)
{
base.Save(writer);
writer.Write((int) 0); // version
affected.Save(writer);
}
public CompanyStrike(BinaryReader reader, Map map) : base(reader, map)
{
int version = reader.ReadInt32();
affected = new Player(reader);
}
public override bool PlayerLosesTurn(Player player)
{
return player.ID == affected.ID;
}
public override string ToString()
{
return Game.ColorName[affected.TrackColor] + " Workers Strike\rNo movement or building";
}
}
}