Pete Letkeman wrote:I find sometimes is nice to have as much logic as I can in private methods provided it will not be shared with other members.
This would allow private methods to be totally rewritten without changing the public method too much.
However you may need to know about Lambdas to full advantage of them.
I suggest that you spend some time defining your classes and stubbing methods as you go. This will give you a better idea of what is needed and how it is used.
Pete Letkeman wrote:Steven, enums are implicitly final and most IDEs will suggest that you remove the final keyword if used with an enum.
Pete Letkeman wrote:With regards to Collections.shuffle(), this will probably work.
Pete Letkeman wrote:However along with that you should really look into implementing and overriding the equals(), hashCode() and toString() methods in your classes.
Pete Letkeman wrote:Would the player sort their cards? I know that I sort my cards in nearly every card game I play. So giving the user that option may not be a bad idea.
Pete Letkeman wrote:By the way, I do not know if you pick up on this yet or not, but the Ace can have either a value of 1 or a value of 11.
Pete Letkeman wrote:We know 100% what is in a deck of cards, so making each card final could work. I'm not sure if it would better to load the collection using a loop or hard coding them.
Loops can be quick to code, but you know exactly what is in the deck so hard coding them could result in a micro/nano second or two when compiling and/or executing the program.
Pete Letkeman wrote:During the game actions like [H]it, [S]tand, [R]aise, [F]old, [B]et etc.
Pete Letkeman wrote:Each user action is a behavior which may use an interface to change any system state value like increasing the money bet.
Steven Mcdonald wrote:Sorry about the bright post, I misspelled quote at the top and of course it was one of the only times in my life that I haven't double checked a post before submitting. I looked it up and I guess I need cows? to edit the post.
Yes and no it all depends on the reasons for doing such an operation.
Steven Mcdonald wrote:I haven't overridden any classes. Should I do this?
Knute Snortum wrote:A basic question about the GitHub account: are we trying to create one project that we all work on, or different projects in different branches? I hope it's the former, and if so, I will wait until Pete has posted the base code to work on.
Adrian Grabowski wrote:Ok, I finally found some time to catch up, made couple of small commits to Steven's branch and it looks like I haven't broken anything yet ;)
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton