This is probably a work in process, but I I re-wrote strategy to use a Strategy object instead of numerous functions. It also includes some basic building block strategy objects that users can use to build strategies. Here are some highlights:
The overridable after_roll method allows strategies to determine objects on a table after the roll, but prior to the bets and table being updated. This makes strategies like Place68CPR that depend on the status of bets that are placed possible without having to imply it from the state of the table.
There is an AggregateStrategy which can be created from the add method of strategy allowing users to combine multiple strategies into one. For example, BetPassLine(5) + PassLineOdds(2) would place a 5 dollar bet on the pass line and 2x odds of the pass line bet.
BetIfTrue takes a Bet object and a callable key which returns a boolean based on the table/player attributes to determine whether the bet should be placed. For example, BetIfTrue(PassLine(5), lambda p, t: t.point.status == 'Off') would place a pass line bet if the point is off. This works similarly to Pythons built in filter function. And would allow users to make simple Strategies based on lambdas.
RemoveIfTrue is similar except for removing bets, ex to remove all Place bets it's RemoveIfTrue(lambda b, p, t: isinstance(b, Place)
A lot of building blocks based on BetIfTrue: BetPointOff, BetPointOn, BetPassLine, CountStrategy, etc.
Another building block is OddStrategy which places odds based on a multiplier and type. Ex. OddsStrategy(PassLine, 2) places 2x odds on the PassLine.
I also included all of the existing strategies (which should be working) all based on the new building blocks, and included Place68CPR which was originally not working as well.
This is probably a work in process, but I I re-wrote strategy to use a Strategy object instead of numerous functions. It also includes some basic building block strategy objects that users can use to build strategies. Here are some highlights: