Ejemplo n.º 1
0
        //for console game start initialization
        public void Initialize(string ip)
        {
            matrix                 = new CoreMatrix();
            playWindow             = new PlayWindow(this, "Chess", new GuiMatrix(matrix));
            playWindow.FormClosed += new FormClosedEventHandler(PlayWindowClose);

            PlayerClock          = new System.Windows.Forms.Timer();
            PlayerClock.Tick    += new EventHandler(PlayerClock_Tick);
            PlayerClock.Interval = 1000;


            if (ip == "0.0.0.0")
            {
                StartServer();
            }
            else
            {
                StartClient(ip);
            }

            PlayerClock.Start();
            playWindow.Show();

            Debug.NewMessage("play window show");


            Application.Run();
        }
Ejemplo n.º 2
0
        private void ReInitialize()
        {
            runColor               = FigureColor.WHITE;
            matrix                 = new CoreMatrix();
            playWindow             = new PlayWindow(this, "Chess", new GuiMatrix(matrix));
            playWindow.FormClosed += new FormClosedEventHandler(PlayWindowClose);

            inviteWindow           = new InviteWindow(pCollection);
            inviteWindow.OnChoice += new InviteWindow.OnChoiceEventHandler(InviteWindowMessageReceived);
            inviteWindow.Show();
        }
Ejemplo n.º 3
0
        private void Start()
        {
            runColor               = FigureColor.WHITE;
            matrix                 = new CoreMatrix();
            playWindow             = new PlayWindow(this, "Chess", new GuiMatrix(matrix));
            playWindow.FormClosed += new FormClosedEventHandler(PlayWindowClose);

            PlayerClock          = new System.Windows.Forms.Timer();
            PlayerClock.Tick    += new EventHandler(PlayerClock_Tick);
            PlayerClock.Interval = 1000;
            endGameLock          = false;
            PlayerClock.Start();
            playWindow.Show();
        }
Ejemplo n.º 4
0
        public void Initialize()
        {
            matrix                 = new CoreMatrix();
            playWindow             = new PlayWindow(this, "Chess", new GuiMatrix(matrix));
            playWindow.FormClosed += new FormClosedEventHandler(PlayWindowClose);

            PlayerClock          = new System.Windows.Forms.Timer();
            PlayerClock.Tick    += new EventHandler(PlayerClock_Tick);
            PlayerClock.Interval = 1000;

            inviteWindow           = new InviteWindow(pCollection);
            inviteWindow.OnChoice += new InviteWindow.OnChoiceEventHandler(InviteWindowMessageReceived);
            inviteWindow.Show();
            Application.Run();
        }
Ejemplo n.º 5
0
        public Object Clone()
        {
            CoreMatrix clone = new CoreMatrix();

            for (int i = 0; i < 8; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    clone.sMatrix[i, j] = sMatrix[i, j];
                }
            }

            clone.KingBlack = KingBlack;
            clone.KingWhite = KingWhite;

            return(clone);
        }
Ejemplo n.º 6
0
        public GuiMatrix(CoreMatrix coreMatrix)
        {
            oldFocused = new Point(int.MaxValue, int.MaxValue);
            oldSelected = new Point(int.MaxValue, int.MaxValue);
            sMatrix = new Spot[8, 8];
            Position pos = new Position();
            for (pos.X = 0; !pos.errorFlag; pos.X++)
            {
                for (pos.Y = 0; !pos.errorFlag; pos.Y++)
                {
                    if ((pos.X + pos.Y) % 2 != 0)
                    {
                        try
                        {
                            sMatrix[pos.X, pos.Y] = new Spot(pos.X, pos.Y, Color.CadetBlue, coreMatrix.FigureAt(pos).image);
                        }
                        catch (System.NullReferenceException)
                        {
                            sMatrix[pos.X, pos.Y] = new Spot(pos.X, pos.Y, Color.CadetBlue, null);
                        }
                    }
                    else
                    {
                        try
                        {
                            sMatrix[pos.X, pos.Y] = new Spot(pos.X, pos.Y, Color.White, coreMatrix.FigureAt(pos).image);
                        }
                        catch (System.NullReferenceException)
                        {
                            sMatrix[pos.X, pos.Y] = new Spot(pos.X, pos.Y, Color.White, null);
                        }

                    }
                }
            }
        }
Ejemplo n.º 7
0
		public Object Clone()
		{
			CoreMatrix clone = new CoreMatrix();

			for(int i=0; i<8; i++)
				for(int j=0; j<8; j++)
					clone.sMatrix[i, j] = sMatrix[i, j];

			clone.KingBlack = KingBlack;
			clone.KingWhite = KingWhite;

			return clone;
		}
Ejemplo n.º 8
0
        public void Initialize()
        {
            matrix = new CoreMatrix();
            playWindow = new PlayWindow(this, "Chess", new GuiMatrix(matrix));
            playWindow.FormClosed += new FormClosedEventHandler(PlayWindowClose);

            PlayerClock = new System.Windows.Forms.Timer();
            PlayerClock.Tick += new EventHandler(PlayerClock_Tick);
            PlayerClock.Interval = 1000;

            inviteWindow = new InviteWindow(pCollection);
            inviteWindow.OnChoice += new InviteWindow.OnChoiceEventHandler(InviteWindowMessageReceived);
            inviteWindow.Show();
            Application.Run();
        }
Ejemplo n.º 9
0
        private void ReInitialize()
        {
            runColor = FigureColor.WHITE;
            matrix = new CoreMatrix();
            playWindow = new PlayWindow(this, "Chess", new GuiMatrix(matrix));
            playWindow.FormClosed += new FormClosedEventHandler(PlayWindowClose);

            inviteWindow = new InviteWindow(pCollection);
            inviteWindow.OnChoice += new InviteWindow.OnChoiceEventHandler(InviteWindowMessageReceived);
            inviteWindow.Show();
        }
Ejemplo n.º 10
0
        //for console game start initialization
        public void Initialize(string ip)
        {
            matrix = new CoreMatrix();
            playWindow = new PlayWindow(this, "Chess", new GuiMatrix(matrix));
            playWindow.FormClosed += new FormClosedEventHandler(PlayWindowClose);

            PlayerClock = new System.Windows.Forms.Timer();
            PlayerClock.Tick += new EventHandler(PlayerClock_Tick);
            PlayerClock.Interval = 1000;

            if (ip == "0.0.0.0")
                StartServer();
            else
                StartClient(ip);

            PlayerClock.Start();
            playWindow.Show();

            Debug.NewMessage("play window show");

            Application.Run();
        }