I am writing a card game program. I am having difficulty with getting one object to reference another. I suppose the problem is that I am unsure of who asks what. THis is my first attempt at writing a real program, and I have the majority of teh code written. i have:
Card.java - defines all the cards in a deck
Deck.java - deals out cards
Hand.java - a single hand of cards
Player.java - a single player
Game.java - creates a share deck and controls events
When I create a shared deck, is that what will be in my main code? If so, how do I each player's hand to draw a different card from that shared deck? I pretty much have all I need to display the cards in the hand, but my biggest problem is this deck issue. So far, in main, when I get my initial 5 cards, I am getting the same sequence of cards for each player, and each individual player will have two of the same cards. Anyone have any ideas?