Example #1
0
 public GameForm(Player[] players, Options options, int firstPlayer)
 {
     InitializeComponent();
     LoadFonts();
     Icon         = CommonProperties.GetIcon();
     this.options = options;
     this.players = players;
     Text         = players[0].name + " vs " + players[1].name;
     labels       = new Label[, ] {
         { lblP1State, lblP1Name, lblP1Type, lblP1Time, lblP1Score, lblP1Log },
         { lblP2State, lblP2Name, lblP2Type, lblP2Time, lblP2Score, lblP2Log }
     };
     picBox = new PictureBox[] { pictureBox2, pictureBox3 };
     for (int i = 0; i < 2; i++)
     {
         for (int e = 0; e < 5; e++)
         {
             if (e == 1)
             {
                 labels[i, e].Text = players[i].name;
             }
             else if (e == 2)
             {
                 labels[i, e].Text = playerType[players[i].type];
             }
             labels[i, e].ForeColor = players[i].color;
         }
     }
     BackColor           = options.backColor;
     lblTime1.ForeColor  = options.boardColor;
     lblTime2.ForeColor  = options.boardColor;
     lblScore1.ForeColor = options.boardColor;
     lblScore2.ForeColor = options.boardColor;
     if (players[0].imageLocation != "")
     {
         pictureBox2.ImageLocation = players[0].imageLocation;
     }
     else
     {
         pictureBox2.Image = Properties.Resources.electronic_ai;
     }
     if (players[1].imageLocation != "")
     {
         pictureBox3.ImageLocation = players[1].imageLocation;
     }
     else
     {
         pictureBox3.Image = Properties.Resources.electronic_ai;
     }
     for (int i = 0; i < 2; i++)
     {
         if (players[i].type == 1)
         {
             players[i].brain.Init(players[i].id, options.searchDepth);
         }
     }
     players[0].score = players[1].score = 0;                          //right place?
     game             = new Game(players[0], players[1], firstPlayer); //0 => firstPlayer
 }
Example #2
0
 public InfoForm(string message, int seconds)
 {
     InitializeComponent();
     LoadFonts();
     Icon         = CommonProperties.GetIcon();
     this.message = message;
     this.seconds = seconds;
 }
 public OptionsForm(Options options)
 {
     InitializeComponent();
     LoadFonts();
     Icon             = CommonProperties.GetIcon();
     this.options     = options;
     _options         = options;
     label2.ForeColor = options.boardColor;
     label4.ForeColor = options.backColor;
     textBox1.Text    = options.searchDepth.ToString();
 }
Example #4
0
 public LanForm(Connection connection)
 {
     InitializeComponent();
     LoadFonts();
     Icon            = CommonProperties.GetIcon();
     this.connection = connection;
     textBox1.Text   = connection.endPoint.Address.ToString();
     if (connection.connectionMode != Connection.Mode.Disconnected)
     {
         SwitchComponents();
     }
 }
Example #5
0
 public MainForm()
 {
     InitializeComponent();
     LoadFonts();
     Icon     = CommonProperties.GetIcon();
     players  = new Player[] { new Player(0), new Player(1) };
     tbxName  = new TextBox[] { tbxP1Name, tbxP2Name };
     lblType  = new Label[] { lblP1Type, lblP2Type };
     lblColor = new Label[] { lblP1Color, lblP2Color };
     picBox   = new PictureBox[] { picBoxP1, picBoxP2 };
     ChangePlayerColor(0, Color.Red);
     ChangePlayerColor(1, Color.Yellow);
     options    = new Options();
     connection = new Connection();
 }
 public ProgressForm()
 {
     InitializeComponent();
     LoadFonts();
     Icon = CommonProperties.GetIcon();
 }
 public PlayerTypeForm()
 {
     InitializeComponent();
     LoadFonts();
     Icon = CommonProperties.GetIcon();
 }
Example #8
0
 public ExternalAIForm()
 {
     InitializeComponent();
     LoadFonts();
     Icon = CommonProperties.GetIcon();
 }