예제 #1
0
        /// <summary>
        /// ���� ���� �����ִ� �޼���
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuItemNew_Click(object sender, System.EventArgs e)
        {
            bMouseCapture = false;
            //���� ���� �����ϸ� ����ؼ� ��ȭ���ڸ� �ٽ� ���� ���� while����.

            // ���� ���� �����ش�.
            StartForm sf = new StartForm();

            // ���� ���� �ϴ��� �� �� �ִ�.
            if(sf.ShowDialog() == DialogResult.Yes)
            {
                nKindOfStartStone = (int)JumInfo.Black;
                UserBitmap = new Bitmap(@"black.GIF");
                UserBitmap.MakeTransparent(Color.Cyan);
                ComBitmap = new Bitmap(@"white.GIF");
                ComBitmap.MakeTransparent(Color.Cyan);
            }
            else
            {
                nKindOfStartStone = (int)JumInfo.White;
                UserBitmap = new Bitmap(@"white.GIF");
                UserBitmap.MakeTransparent(Color.Cyan);
                ComBitmap = new Bitmap(@"black.GIF");
                ComBitmap.MakeTransparent(Color.Cyan);
            }
            GameStart();
        }
예제 #2
0
        /// <summary>
        /// ������
        /// </summary>
        public OmokForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //

            try
            {
                BoardBitmap = new Bitmap(@"board.GIF");
                ClientSize = BoardBitmap.Size;

                omokData = new OmokData();

                // ���� ���� �����ش�.
                StartForm sf = new StartForm();

                // ���� ���� �ϴ��� �� �� �ִ�.
                if(sf.ShowDialog() == DialogResult.Yes)
                {
                    nKindOfStartStone = (int)JumInfo.Black;
                    UserBitmap = new Bitmap(@"black.GIF");
                    UserBitmap.MakeTransparent(Color.Cyan);
                    ComBitmap = new Bitmap(@"white.GIF");
                    ComBitmap.MakeTransparent(Color.Cyan);
                }
                else
                {
                    nKindOfStartStone = (int)JumInfo.White;
                    UserBitmap = new Bitmap(@"white.GIF");
                    UserBitmap.MakeTransparent(Color.Cyan);
                    ComBitmap = new Bitmap(@"black.GIF");
                    ComBitmap.MakeTransparent(Color.Cyan);
                }

                omokData = new OmokData();

                if(nKindOfStartStone == (int)JumInfo.White)
                {	//������ ���̸�
                    Point point = new Point(10,10);		//���� ó�� �� �ڸ��� �����ϰ�
                    omokData.WriteJum(point, nKindOfStartStone); //��(������)�� �д�
                    TurnStone(ref nKindOfStartStone);	//�׸��� �ٽ� ����ڵ��� �ٲ��ش�.
                }
            }
            catch(ArgumentException e)
            {
                MessageBox.Show(e.ToString(), "�̹��� ������ ��θ� �����ϼ���");
            }
        }