diff options
author | MichaĆ Zimniewicz <michzimny@users.noreply.github.com> | 2018-02-14 23:54:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-14 23:54:19 +0100 |
commit | 969e3dd244337fc5e9262cb27931159bfeaf6c0c (patch) | |
tree | 1c0a2ce06509fc4f23ee1d2b7d387d41317d091b /Aktywator/PBNBoard.cs | |
parent | fa8e46acc24c5cf8b607531684b4c9858e4ebb33 (diff) | |
parent | 3a7b77ef81cc80e29d4f3f06a0bb66752e79c936 (diff) |
Merge pull request #40 from emkael/winter-bugfixes
Winter bugfixes
Diffstat (limited to 'Aktywator/PBNBoard.cs')
-rw-r--r-- | Aktywator/PBNBoard.cs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Aktywator/PBNBoard.cs b/Aktywator/PBNBoard.cs index fadfd22..994108e 100644 --- a/Aktywator/PBNBoard.cs +++ b/Aktywator/PBNBoard.cs @@ -88,7 +88,20 @@ namespace Aktywator public String GetLayout() { string[] dealParts = this.GetField("Deal").Split(':'); - return dealParts[dealParts.Length - 1]; + string layout = dealParts[dealParts.Length - 1]; + if (dealParts.Length > 1) + { + string[] layoutParts = layout.Split(' '); + string[] rotatedLayout = { "", "", "", "" }; + char dealer = dealParts[0][0]; + int rotation = Array.IndexOf(DDTable.PLAYERS, dealer); + for (int i = 0; i < rotatedLayout.Length; i++) + { + rotatedLayout[(i + rotation) % rotatedLayout.Length] = layoutParts[i]; + } + layout = String.Join(" ", rotatedLayout); + } + return layout; } public String GetNumber() |