diff options
author | emkael <emkael@tlen.pl> | 2016-11-09 14:20:32 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-11-14 14:47:04 +0100 |
commit | 3fd493b395d27749749587518d76a4e5d648920c (patch) | |
tree | 325daa433c497945657a53e266b4fc5d102bf332 /Aktywator/DDTable.cs | |
parent | be59baaa024f8c5f02ec14fe34155e736548046b (diff) |
* PBN double-dummy data support for HandEvaluation table
Diffstat (limited to 'Aktywator/DDTable.cs')
-rw-r--r-- | Aktywator/DDTable.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Aktywator/DDTable.cs b/Aktywator/DDTable.cs index 38e0fbd..5de9c3b 100644 --- a/Aktywator/DDTable.cs +++ b/Aktywator/DDTable.cs @@ -14,7 +14,8 @@ namespace Aktywator class DDTable { - public static char[] DENOMINATIONS = { 'C', 'D', 'H', 'S', 'N' }; + public static char[] DENOMINATIONS = { 'S', 'H', 'D', 'C', 'N' }; + private static char[] JFR_DENOMS = {'N', 'S', 'H', 'D', 'C'}; public static char[] PLAYERS = { 'N', 'E', 'S', 'W' }; private PBNBoard board; @@ -58,11 +59,13 @@ namespace Aktywator { char player = playerAbility.Groups[1].Value[0]; int playerID = Array.IndexOf(PLAYERS, player); - int denomID = 4; + int denomID; + int denom = 0; foreach (char tricks in playerAbility.Groups[2].Value.ToCharArray()) { + denomID = Array.IndexOf(DENOMINATIONS, JFR_DENOMS[denom]); result[playerID, denomID] = (tricks > '9') ? (tricks - 'A' + 10) : (tricks - '0'); - denomID--; + denom++; } } return this.validateTable(result); |