Ok, I honestly don't know how this works. How would I evaluate hands, Vulpes?
When I click deal and cards displayed then if anything above pair 10's would give player money otherwise it goes back to house / w.e you call him.
As you can see in my Game class I got PayOutMoney method that contains all the hands and such, but now how would I connect that methods with the cards that will be displayed?
The rules are here http://www.coolcat-casino.com/table-games/let-em-ride.php Don't click on PlayNow link because it will open an .exe file.
This link http://www.freepoker.com/free-let-em-ride-poker is if you want to see where I am copying my game from. You can also play it there
Loading

VulpesRank #55 · 29.2K reputationPosted Feb 27, 2012, 1:26 PM EST
I've also made some changes to the Games class so that the money should now reflect the result of the deal :
VulpesRank #55 · 29.2K reputationPosted Feb 25, 2012, 11:53 AM EST
What you need to do now is to figure out the type of the hand using the methods in the Hand, GraphicalCard and Card classes.
It's easier if you sort the hands first which I'd do in the DetermineHandByType method.
I've done the easier ones for you (a bit rushed so watch out for bugs!) but there's a still few more left for you to do:
Prime bRank #2,035 · 712 reputationPosted Feb 25, 2012, 12:40 PM EST
Prime bRank #2,035 · 712 reputationPosted Feb 25, 2012, 2:33 PM EST
I am not sure if its correct the way I finished it.
Maybe you want me to give the info from the account so you can log in and just download it without waiting? If yes just tell me.
http://www.4shared.com/rar/lc5i9glE/LetItRide.html
VulpesRank #55 · 29.2K reputationPosted Feb 26, 2012, 6:11 AM EST
My head's a bit clearer than it was last night and I've noticed a few things I missed before.
Firstly, TWO_OF_A_KIND should be TWO_PAIRS i.e. 2 kings and 2 queens, stuff like that. So the HandType enum needs altering.
Secondly, it would be better from both a coding and efficiency point of view if the method calls in the DetermineHandByType method were rearranged so that the best hands were checked first rather than the worst hands. When checking whether a hand contains say 3 of a kind, we wouldn't then need to check first that it doesn't contain 4 of a kind and then have to perform the same calculation again when it comes to checking for 4 of a kind. In other words, this is what I think we need:
I don't know whether you're allowed to change this code but, if you can, then I think you should.
Thirdly, the code I did for the flush contains a superfluous line which should be deleted:
Finally, the code to do the remaining cases is more complicated than you think. I can correct it but need to know whether it's OK to rearrange the code in the DetermineHandByType method first.
Prime bRank #2,035 · 712 reputationPosted Feb 26, 2012, 6:45 AM EST
So vulpes let's do what you think is the best!
I updated the code, http://www.4shared.com/rar/dUgGwgEu/LetItRide.html
I also going to PM you the info to log in in 4shared, just in case.
VulpesRank #55 · 29.2K reputationPosted Feb 26, 2012, 7:13 AM EST
Here's what I think you need for the last three methods.
When checking whether a hand contains 3 of a kind then (bearing in mind it's sorted), the threesome could be cards 0 to 2, cards 1 to 3 or cards 2 to 4. Similar logic applies to the other 2 hand types:
Prime bRank #2,035 · 712 reputationPosted Feb 26, 2012, 7:20 AM EST
But you probably have the same thing as me.
So this is hand evaluator.
I have a lot more questions, would you like me to open new thread?
And now do I put all these methods to Deal button or?
VulpesRank #55 · 29.2K reputationPosted Feb 26, 2012, 7:57 AM EST
You only need to know what the handtype is when you call the PayOutMoney method and if you change the start of the switch statement in that method to:
then that should cope with that.
If your other questions are to do with hand analysis, then I'd continue asking them on this thread but, if it's a new topic, then I'd start a new one.
Prime bRank #2,035 · 712 reputationPosted Feb 26, 2012, 8:40 AM EST
I added new stuff , http://www.4shared.com/rar/C1PvgcBq/LetItRide.html
VulpesRank #55 · 29.2K reputationPosted Feb 27, 2012, 9:26 AM EST
However, you have a number of problems here.
1. The Game.FlipLeft method which is called when the Continue button is pressed and both cards are displayed needs to call the Game.PayOutMoney method.
2. The PayOutMoney method is not having any effect on the player's money because:
(a) the betAmount field has not been set and so still has its default value of 0.
(b) it needs to call: gui.DisplayPlayerMoney(player.Money);
to display the new amount.
3. The playerMoneyLabel is getting debited again when the Deal button is pressed even though it was already debited when the bet was made. This is because the Game.Bet is being called on both occasions and this in turn calls the Player.GetBetAmount method.
I think you really have a design flaw here - the Player class should store the amount of the bet, not the Game class, and needs both Get and Set methods.
Prime bRank #2,035 · 712 reputationPosted Feb 27, 2012, 11:55 AM EST
http://www.4shared.com/rar/kh6OXWk7/LetItRide.html
Prime bRank #2,035 · 712 reputationPosted Feb 27, 2012, 12:46 PM EST
I did fix the double bet issue, I had a method in Deal button that would deal bet again.
Prime bRank #2,035 · 712 reputationPosted Feb 27, 2012, 1:38 PM EST