static void Main(string[] args) { Parser p = new Parser(); if(args.Length > 0) { Parser.ReadFile(args[0]); } else { askingForFile(); } Game chess = new Game(); chess.PlacePieces(p.GetValidPlacements(),p.GetEnglishEquivalent()); chess.PlayGame(); // chess.PlayGame(p.GetValidMoves(),p.GetEnglishEquivalent(), p.GetValidPlacements().Count); // chess.SquaresWithPieces(); }
// constructor that show the graphic interface to users public Graphics(Game g) : base(Gtk.WindowType.Toplevel) { Build (); int scale = 10; if (Screen.Height < 1000) scale = 5; this.game = g; VBox gridWrapper = new VBox (); HBox box = new HBox (); this.status = new Label (""); this.chooser = new Popup (this, this.game.getChooseableFigures(), handleChooser, scale); this.mainGrid = new GridWidget (this.game, clickHandler, scale); gridWrapper.PackStart (status, false, false, 0); gridWrapper.PackStart (this.mainGrid, false, false, 0); this.sidebarLeft = new SidebarWidget (g.getRemovedFigures (), "black", scale); box.PackStart (new HBox ()); box.PackStart (this.sidebarLeft); box.PackStart (gridWrapper, false, false, 0); this.sidebarRight = new SidebarWidget (g.getRemovedFigures (), "white", scale); box.PackEnd (this.sidebarRight); box.PackStart (new HBox ()); box.ShowAll (); this.Add (box); updateGui (this.game.initialState ()); this.Show (); }
private coord tileSize; // Size of a tile #endregion Fields #region Constructors // Constructor public GridWidget(Game game, Cb callback, int scale) : base((uint)game.getSize ().x, (uint)game.getSize ().y, true) { this.callback = callback; this.clicked = false; this.game = game; this.tileSize = new coord (10 * scale, 10 * scale); }
public static void Main(string[] args) { Application.Init (); //Create game Game g = new Game (); //Create the graphic interface for the game new Graphics (g); Application.Run (); }
public StartingANewGame() { var output = new TestOutput(); _app = new ChessApp(output); _app.Handle(new CreateGameAppCommand()); _latestGameName = output.LatestGameName; _newGame = _app.GetGame(_latestGameName); }
public void OnPlayerJoiningGame(IPlayer player, Game game) { }
public void OnNewGameStarted(Game newGame) { LatestGameName = newGame.Id; }
public void OnColourTakenCannotJoinGameError(PlayerColour playerColour, Game game) { NumberOfColourTakenCannotJoinGameErrors++; }
public void OnPlayerJoiningGame(IPlayer player, Game game) { Console.WriteLine("Player {0} joined {1}.", player.Name, game.Id); }
public void OnNewGameStarted(Game newGame) { Games.Add(newGame); Console.WriteLine("New game: {0}", newGame.Id); }
public void OnColourTakenCannotJoinGameError(PlayerColour playerColour, Game game) { throw new NotImplementedException(); }