//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(); }
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(); }
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(); }
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(); }
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); }
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); } } } } }
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; }
//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(); }