private Boolean EmptyCheck(Locations theSpot, int horizontalMovement, int verticalMovement) { bool valid = false; if (board[theSpot.Column + horizontalMovement, theSpot.Row + verticalMovement] == 0) { valid = true; } return valid; }
private void CreateAnO(Locations theSpot, Color color) { System.Drawing.Graphics graphicsObj; graphicsObj = this.CreateGraphics(); Pen myPen = new Pen(color, 10); int CornerX = 33 + (80 * theSpot.Column); int CornerY = 33 + (80 * theSpot.Row); graphicsObj.DrawEllipse(myPen, CornerX, CornerY, 54, 54); }
private void MovedPiece(Locations theSpot) { if (theSpot.Turn % 2 == 1) { CreateAnX(theSpot, System.Drawing.Color.Purple); } else { CreateAnO(theSpot, System.Drawing.Color.Purple); } }
private void CreateAnX(Locations theSpot, Color color) { System.Drawing.Graphics graphicsObj; graphicsObj = this.CreateGraphics(); Pen myPen = new Pen(color, 10); int Corner1x = 33 + (80 * theSpot.Column); int Corner1y = 33 + (80 * theSpot.Row); int Corner2x = 87 + (80 * theSpot.Column); int Corner2y = 87 + (80 * theSpot.Row); graphicsObj.DrawLine(myPen, Corner1x, Corner1y, Corner2x, Corner2y); graphicsObj.DrawLine(myPen, Corner2x, Corner1y, Corner1x, Corner2y); }
private void MovementAfterPlace(Locations theSpot) { if (theSpot.Column != 2) { theSpot.Column += 1; } }
private void RemovePiece(Locations theSpot) { board[theSpot.Column, theSpot.Row] = theSpot.Turn; if (theSpot.Turn % 2 == 1) { CreateAnX(theSpot, System.Drawing.SystemColors.Control); } else { CreateAnO(theSpot, System.Drawing.SystemColors.Control); } }
private void PlacePiece(Locations theSpot) { if (theSpot.Turn % 2 == 1) { CreateAnX(theSpot, System.Drawing.Color.Blue); } else { CreateAnO(theSpot, System.Drawing.Color.Red); } theSpot.Turn += 1; }