public bool ProcessOrders() { if (!thinking) { return(false); } lock (this) { while (this.Orders.Count > 0) { Order order = this.Orders[0]; this.Orders.RemoveAt(0); System.Console.WriteLine(string.Format("Processing order : {0}", order.ToString())); if (order is GameOrder) { this.game.ProcessOrder(order as GameOrder); } else if (order is Order_Terminate) { this.IsOver = true; } this.GameVue = this.game.GetVue(); } } this.thinking = false; return(true); }
static void Main(string[] args) { System.Console.WriteLine("Starting"); CardGame.Bataille bataille = new CardGame.Bataille(); Program.Game = bataille; System.Console.WriteLine("Started"); Program.mainDiv = new HTMLDivElement(); Document.Body.AppendChild(Program.mainDiv); Program.gameVue = Program.Game.GetVue(); Program.DisplayPlayState(); System.Console.WriteLine("Ended"); }
public ComunicationLayer(Bataille game) { this.game = game; this.GameVue = this.game.GetVue(); }
private static void OnMultiplyButtonClicked() { Program.Game.ProcessOrder(new CardGame.Order_Multiply()); Program.gameVue = Program.Game.GetVue(); Program.DisplayPlayState(); }
private static void OnBankButtonCliked() { Program.Game.ProcessOrder(new CardGame.Order_Score()); Program.gameVue = Program.Game.GetVue(); Program.DisplayPlayState(); }