Click here to Skip to main content
15,901,373 members
Home / Discussions / C#
   

C#

 
QuestionException-When minimized and restored Pin
cloudking119669-Nov-05 17:34
cloudking119669-Nov-05 17:34 
AnswerRe: Exception-When minimized and restored Pin
Heath Stewart9-Nov-05 22:09
protectorHeath Stewart9-Nov-05 22:09 
AnswerRe: Exception-When minimized and restored Pin
S. Senthil Kumar10-Nov-05 4:19
S. Senthil Kumar10-Nov-05 4:19 
QuestionClass that can read/modify private values of another class Pin
budidharma9-Nov-05 11:30
budidharma9-Nov-05 11:30 
AnswerRe: Class that can read/modify private values of another class Pin
Leslie Sanford9-Nov-05 11:50
Leslie Sanford9-Nov-05 11:50 
GeneralRe: Class that can read/modify private values of another class Pin
budidharma9-Nov-05 12:17
budidharma9-Nov-05 12:17 
GeneralRe: Class that can read/modify private values of another class Pin
Leslie Sanford9-Nov-05 12:21
Leslie Sanford9-Nov-05 12:21 
GeneralRe: Class that can read/modify private values of another class Pin
budidharma9-Nov-05 13:14
budidharma9-Nov-05 13:14 
Ok, scared me for a second. I thought I was missing some fundamental understanding of C#. I just realized after reading through my code, that by simply writing three more public methods, I can transfer the dealer logic to the table logic - and the logic is better placed in the table anyways.

public BetAction[] GetPossibleActions(int Position); // Return an array of possible actions, given the game context, for the specified player.

public Update(BetAction Action, int Position); // Update the game context, given the player action at the specified position.

public int NextPlayerToAct(); // Return the position of the next player to act, given active players

By simply calling GetPossibleActions(NextPlayerToAct()), you'll recieve an array of possible actions. If it's empty - the hand's over and the simulator (or whatever is controlling input to the table) will simply call StartNextRound() (which may call FinalizeHand(), if your on the last hand).

If there are possible actions, (I have written public properties for the table which allow viewing, but not modifying table values), whatever selects the decision can view those properties and make a decision, then simply call the Update(SpecifiedAction, CurrentActingPlayer) which will update the game context and the player object.

... In other words, after thinking about this for awhile, I realized I don't need another class with private access.

Thanks!
GeneralRe: Class that can read/modify private values of another class Pin
Leslie Sanford9-Nov-05 15:19
Leslie Sanford9-Nov-05 15:19 
QuestionHow do i create a link to a web page? Pin
Anthony Mushrow9-Nov-05 10:07
professionalAnthony Mushrow9-Nov-05 10:07 
AnswerRe: How do i create a link to a web page? Pin
Matt Gerrans9-Nov-05 11:32
Matt Gerrans9-Nov-05 11:32 
GeneralRe: How do i create a link to a web page? Pin
Anthony Mushrow9-Nov-05 12:22
professionalAnthony Mushrow9-Nov-05 12:22 
QuestionRe: How do i create a link to a web page? Pin
Anthony Mushrow9-Nov-05 12:42
professionalAnthony Mushrow9-Nov-05 12:42 
AnswerRe: How do i create a link to a web page? Pin
Luis Alonso Ramos9-Nov-05 13:15
Luis Alonso Ramos9-Nov-05 13:15 
GeneralRe: How do i create a link to a web page? Pin
Matt Gerrans9-Nov-05 15:59
Matt Gerrans9-Nov-05 15:59 
GeneralRe: How do i create a link to a web page? Pin
Luis Alonso Ramos9-Nov-05 19:28
Luis Alonso Ramos9-Nov-05 19:28 
QuestionCan a C# class be made aware as soon as its instance goes out of function scope? Pin
chervu9-Nov-05 9:32
chervu9-Nov-05 9:32 
AnswerRe: Can a C# class be made aware as soon as its instance goes out of function scope? Pin
Daniel Turini9-Nov-05 10:07
Daniel Turini9-Nov-05 10:07 
QuestionOverloading the assignment operator Pin
budidharma9-Nov-05 9:12
budidharma9-Nov-05 9:12 
AnswerRe: Overloading the assignment operator Pin
leppie9-Nov-05 10:14
leppie9-Nov-05 10:14 
QuestionSorting a ArrayList on multiple fields Pin
miah alom9-Nov-05 9:00
miah alom9-Nov-05 9:00 
AnswerRe: Sorting a ArrayList on multiple fields Pin
Leslie Sanford9-Nov-05 9:41
Leslie Sanford9-Nov-05 9:41 
GeneralRe: Sorting a ArrayList on multiple fields Pin
miah alom9-Nov-05 11:07
miah alom9-Nov-05 11:07 
QuestionCustomizing PropertyGrid to show hyperlinks Pin
markjkruger9-Nov-05 8:10
markjkruger9-Nov-05 8:10 
QuestionGantt chart component Pin
ppp0019-Nov-05 6:58
ppp0019-Nov-05 6:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.