summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/PBNBoard.cs17
-rw-r--r--src/PBNFile.cs4
2 files changed, 21 insertions, 0 deletions
diff --git a/src/PBNBoard.cs b/src/PBNBoard.cs
index d60bfe3..7578fbe 100644
--- a/src/PBNBoard.cs
+++ b/src/PBNBoard.cs
@@ -100,6 +100,23 @@ namespace BCDD
}
}
+ public String GetEvent()
+ {
+ return this.GetField("Event");
+ }
+
+ public void WriteEvent(String name)
+ {
+ for (int i = 0; i < this.Fields.Count; i++)
+ {
+ if ("Board".Equals(this.Fields[i].Key))
+ {
+ this.Fields.Insert(i, new PBNField("Event", name));
+ break;
+ }
+ }
+ }
+
public String GetLayout()
{
return this.GetField("Deal");
diff --git a/src/PBNFile.cs b/src/PBNFile.cs
index 5526623..b26f84c 100644
--- a/src/PBNFile.cs
+++ b/src/PBNFile.cs
@@ -40,6 +40,10 @@ namespace BCDD
{
this.Boards.Add(new PBNBoard(lines));
}
+ if (!this.Boards[0].HasField("Event"))
+ {
+ this.Boards[0].WriteEvent("");
+ }
}
public void WriteBoard(PBNBoard board)