accessing one object from another

New to C++ I used to PHP where you can pass objects around like candy. here is my situation and advice would be much appreciated.

I am creating a simple console application that allows to players to play a game of texas holdem poker against one another.

I created two classes:
class Player
class PokerTable

Class player has properties name, hand,money,position and methods bet, raise, fold, call ect..

Class PokerTable handles the flow of the game has properties Deck,cardsOnTable,Pot and Methods dealCards,dealFlop,dealTurn,dealRiver,calculateHandWinner.

My trouble is I need to access values from the player objects in order to run the PokerTable methods. For example the PokerTable::dealCards() method needs to take two random cards from the deck array and set the Players hand property.

What is the best way to do this??
Make the dealCards function take a Player by reference.
Last edited on
Topic archived. No new replies allowed.