Skip to content

Commit

Permalink
Merge pull request #39 from HHSmithy/master
Browse files Browse the repository at this point in the history
Resync with HHSmithy
  • Loading branch information
ItalyToast committed Mar 23, 2015
2 parents a0a21ba + 76a1874 commit bbb9666
Show file tree
Hide file tree
Showing 13 changed files with 550 additions and 44 deletions.
2 changes: 1 addition & 1 deletion HandHistories.Objects/Actions/HandAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class HandAction
PlayerName = playerName;
Amount = GetAdjustedAmount(amount, handActionType);
ActionNumber = actionNumber;
IsAllIn = false;
IsAllIn = AllInAction;
}

public override int GetHashCode()
Expand Down
12 changes: 12 additions & 0 deletions HandHistories.Objects/GameDescription/GameTypeUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static GameType ParseGameString(string gameString)
case "fl hold'em":
case "fixed holdem":
case "fixed hold'em":
case "limit hold'em":
return GameType.FixedLimitHoldem;
case "pl omaha":
case "plo":
Expand All @@ -42,7 +43,18 @@ public static GameType ParseGameString(string gameString)
case "plo hi-lo":
return GameType.PotLimitOmahaHiLo;
case "omaha hi-lo no limit":
case "no limit omaha hi-lo":
return GameType.NoLimitOmahaHiLo;
case "fl omaha hi-lo":
return GameType.FixedLimitOmahaHiLo;
case "fixed limit omaha":
return GameType.FixedLimitOmaha;
case "no limit omaha":
return GameType.NoLimitOmaha;
case "pot limit five card omaha hi-lo":
return GameType.FiveCardPotLimitOmahaHiLo;
case "pot limit five card omaha":
return GameType.FiveCardPotLimitOmaha;
default:
string match = Enum.GetNames(typeof(GameType)).FirstOrDefault(g => g.ToLower().Equals(gameString.ToLower()));
return match == null ? GameType.Unknown : (GameType)Enum.Parse(typeof(GameType), match,true);
Expand Down
27 changes: 27 additions & 0 deletions HandHistories.Objects/GameDescription/PokerFormatUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,32 @@ public static string GetDisplayName(PokerFormat pokerFormat)
return pokerFormat.ToString();
}
}

public static PokerFormat ParseFormatName(string pokerformat)
{
switch (pokerformat.ToLower())
{
case "cash game":
case "cashgame":
case "cg":
case "cash":
return PokerFormat.CashGame;

case "sng":
case "sitandgo":
case "sit and go":
case "sitngo":
case "sit&go":
return PokerFormat.SitAndGo;

case "mtt":
case "multitabletournament":
case "multi table tournament":
return PokerFormat.MultiTableTournament;

}

return PokerFormat.Unknown;
}
}
}
2 changes: 2 additions & 0 deletions HandHistories.Objects/GameDescription/SiteNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public enum SiteName : byte
PokerStarsZoom = 26,
Winamax = 27,
WinningPoker = 28,
PartyPokerNJ = 29,
PartyPokerEs = 30,
All = 63 // note: can't go higher than 63 due to bit value optimizations
}
}
16 changes: 16 additions & 0 deletions HandHistories.Objects/GameDescription/SiteUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ public static string GetDisplaySiteName(SiteName siteName)
return "Poker Stars Fr";
case SiteName.PokerStarsEs:
return "Poker Stars Es";
case SiteName.IPoker:
return "iPoker";
case SiteName.IPoker2:
return "iPoker - Low";
default:
return siteName.ToString();
}
Expand Down Expand Up @@ -51,6 +55,9 @@ public static SiteName ParseSiteName(string site)
case "pty":
case "pp":
return SiteName.PartyPoker;
case "ipoker1":
case "ipoker-top":
case "ipoker - top":
case "ipoker":
case "titanpoker":
case "titan":
Expand All @@ -64,6 +71,7 @@ public static SiteName ParseSiteName(string site)
return SiteName.Cereus;
case "ongame":
case "on game":
case "bestpoker":
return SiteName.OnGame;
case "bodog":
return SiteName.Bodog;
Expand Down Expand Up @@ -101,6 +109,12 @@ public static SiteName ParseSiteName(string site)
case "partyit":
case "partypokerit":
return SiteName.PartyPokerIt;
case "partynj":
case "partypokernj":
return SiteName.PartyPokerNJ;
case "partyes":
case "partypokeres":
return SiteName.PartyPokerEs;
case "ongameit":
return SiteName.OnGameIt;
case "ongamefr":
Expand All @@ -110,6 +124,8 @@ public static SiteName ParseSiteName(string site)
case "ipokerfr":
return SiteName.IPokerFr;
case "ipoker2":
case "ipoker - low":
case "ipoker-low":
case "betmost":
return SiteName.IPoker2;
case "888":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,95 @@ protected override List<HandAction> ExpectedHandActionsBasicHand
{
get
{
Assert.Ignore("Hand Actions not implemented");
throw new NotImplementedException();
var actions = new List<HandAction>()
{
new HandAction("Rene Lacoste", HandActionType.SMALL_BLIND, 5m, Street.Preflop),
new HandAction("ElkY", HandActionType.BIG_BLIND, 10m, Street.Preflop),
new HandAction("Rene Lacoste", HandActionType.RAISE, 15m, Street.Preflop),
new HandAction("ElkY", HandActionType.CALL, 10m, Street.Preflop),
new HandAction("ElkY", HandActionType.CHECK, 0m, Street.Flop),
new HandAction("Rene Lacoste", HandActionType.BET, 20m, Street.Flop),
new HandAction("ElkY", HandActionType.FOLD, 0m, Street.Flop),
new HandAction("Rene Lacoste", HandActionType.UNCALLED_BET, 20m, Street.Flop),
new HandAction("Rene Lacoste", HandActionType.MUCKS, 0m, Street.Flop),
new WinningsAction("Rene Lacoste", HandActionType.WINS, 39.50m, 0),
};

return actions;
}
}

protected override List<HandAction> ExpectedHandActionsFoldedPreflop
{
get
{
Assert.Ignore("Hand Actions not implemented");
throw new NotImplementedException();
var actions = new List<HandAction>()
{
new HandAction("gosuoposum1", HandActionType.SMALL_BLIND, 5m, Street.Preflop),
new HandAction("goSuckout", HandActionType.BIG_BLIND, 10m, Street.Preflop),
new HandAction("gosuoposum1", HandActionType.FOLD, 0m, Street.Preflop),
new HandAction("goSuckout", HandActionType.UNCALLED_BET, 5m, Street.Preflop),
new HandAction("goSuckout", HandActionType.MUCKS, 0m, Street.Preflop),
new WinningsAction("goSuckout", HandActionType.WINS, 10m, 0),
};

return actions;
}
}

protected override List<HandAction> ExpectedHandActions3BetHand
{
get
{
Assert.Ignore("Hand Actions not implemented");
throw new NotImplementedException();
var actions = new List<HandAction>()
{
new HandAction("jobetzu", HandActionType.SMALL_BLIND, 5m, Street.Preflop),
new HandAction("theking881", HandActionType.BIG_BLIND, 10m, Street.Preflop),
new HandAction("jobetzu", HandActionType.RAISE, 15m, Street.Preflop),
new HandAction("theking881", HandActionType.RAISE, 40m, Street.Preflop),
new HandAction("jobetzu", HandActionType.CALL, 30m, Street.Preflop),

new HandAction("theking881", HandActionType.BET, 30m, Street.Flop),
new HandAction("jobetzu", HandActionType.FOLD, 0m, Street.Flop),
new HandAction("theking881", HandActionType.UNCALLED_BET, 30m, Street.Flop),
new HandAction("theking881", HandActionType.MUCKS, 0m, Street.Flop),
new WinningsAction("theking881", HandActionType.WINS, 99.50m, 0),
};

return actions;
}
}

protected override List<HandAction> ExpectedHandActionsAllInHand
{
get
{
Assert.Ignore("Hand Actions not implemented");
throw new NotImplementedException();
var actions = new List<HandAction>()
{
new HandAction("theking881", HandActionType.SMALL_BLIND, 5m, Street.Preflop),
new HandAction("jobetzu", HandActionType.BIG_BLIND, 10m, Street.Preflop),
new HandAction("theking881", HandActionType.RAISE, 20m, Street.Preflop),
new HandAction("jobetzu", HandActionType.CALL, 15m, Street.Preflop),

new HandAction("jobetzu", HandActionType.CHECK, 0m, Street.Flop),
new HandAction("theking881", HandActionType.BET, 25m, Street.Flop),
new HandAction("jobetzu", HandActionType.CALL, 25m, Street.Flop),

new HandAction("jobetzu", HandActionType.CHECK, 0m, Street.Turn),
new HandAction("theking881", HandActionType.BET, 50m, Street.Turn),
new HandAction("jobetzu", HandActionType.RAISE, 120m, Street.Turn),
new HandAction("theking881", HandActionType.CALL, 70m, Street.Turn),

new HandAction("jobetzu", HandActionType.BET, 170m, Street.River),
new HandAction("theking881", HandActionType.CALL, 138m, Street.River, true),
new HandAction("jobetzu", HandActionType.UNCALLED_BET, 32m, Street.River),

new HandAction("jobetzu", HandActionType.SHOW, 0m, Street.Showdown),
new HandAction("theking881", HandActionType.MUCKS, 0m, Street.Showdown),
new WinningsAction("jobetzu", HandActionType.WINS, 615.50m, 0),
};

return actions;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace HandHistories.Parser.UnitTests.Parsers.HandSummaryParserTests.Tables
{
[TestFixture("PartyPoker", "Regular", "Regular", "Regular", "Regular")]
[TestFixture("PokerStars", "Regular", "Regular", "Regular", "Regular", "Zoom", "Cap")]
[TestFixture("PokerStars", "Regular", "Regular", "Deep", "Regular", "Zoom", "Cap")]
[TestFixture("OnGame", "Regular", "Regular", "Regular", "Speed")]
[TestFixture("IPoker", "Regular", "Regular", "Regular", "Shallow")]
[TestFixture("Pacific", "Regular", "Regular", "Regular", "Regular")]
Expand Down
Loading

0 comments on commit bbb9666

Please sign in to comment.