Click here to Skip to main content
15,895,462 members
Home / Discussions / C#
   

C#

 
AnswerRe: Drawing Lines On A Form Pin
Heath Stewart9-Nov-05 21:45
protectorHeath Stewart9-Nov-05 21:45 
QuestionNeed Help with .NET Pin
allenmpcx9-Nov-05 19:26
allenmpcx9-Nov-05 19:26 
AnswerRe: Need Help with .NET Pin
AETaylor10-Nov-05 22:14
AETaylor10-Nov-05 22:14 
QuestionDifferent Source Codes Pin
nosferatu20009-Nov-05 19:23
nosferatu20009-Nov-05 19:23 
AnswerRe: Different Source Codes Pin
Luis Alonso Ramos9-Nov-05 19:35
Luis Alonso Ramos9-Nov-05 19:35 
QuestionMaskedTextBox Problem ! Pin
Caio19859-Nov-05 17:42
Caio19859-Nov-05 17:42 
GeneralRe: MaskedTextBox Problem ! Pin
Heath Stewart9-Nov-05 22:11
protectorHeath Stewart9-Nov-05 22:11 
QuestionRetrieving an image data type Pin
SyedZubair9-Nov-05 17:39
SyedZubair9-Nov-05 17:39 
AnswerRe: Retrieving an image data type Pin
Heath Stewart9-Nov-05 21:59
protectorHeath Stewart9-Nov-05 21:59 
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 
GeneralRe: Class that can read/modify private values of another class Pin
Leslie Sanford9-Nov-05 15:19
Leslie Sanford9-Nov-05 15:19 
I probably don't know enough about your application to advise you, but I won't let that stop me. Smile | :)

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


Do you have a Player class? Would that be a good idea, do you think?

Also, who decides what the next BetAction will be? Maybe the logic for deciding should be in the Player class? If the logic varies, maybe have an IPlayer interface that can be implemented with various player strategy classes.

Here's what the code might look like:

public interface IPlayer
{
    bool Bet();

    event BetEventArgs BetPlaced;
}


Then somewhere else in your application:

PlayerCollection players = new PlayerCollection();

players.Add(new ConservativePlayer("Harry"));
players.Add(new AggressivePlayer("Joe"));
players.Add(new ModeratePlayer("Sue"));

// ...

foreach(Player p in players)
{
    if(!p.Bet())
    {
        break;
    }
}


The break looks ugly, and I'm sure there are cleaner ways of doing it. In part my suggestion is just guessing at a solution, but what I'm trying to get it is that maybe you should consider delegating some of the responsibilities of the table class to other classes. By putting everything in the table class, you may wind up with a monolithic class (a "God") class that does everything. This isn't considered good design in many circles.

Just a thought, and feel free to ignore it. Smile | :)
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 

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.