Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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");
        }
Exemplo n.º 3
0
 public ComunicationLayer(Bataille game)
 {
     this.game    = game;
     this.GameVue = this.game.GetVue();
 }
Exemplo n.º 4
0
 private static void OnMultiplyButtonClicked()
 {
     Program.Game.ProcessOrder(new CardGame.Order_Multiply());
     Program.gameVue = Program.Game.GetVue();
     Program.DisplayPlayState();
 }
Exemplo n.º 5
0
 private static void OnBankButtonCliked()
 {
     Program.Game.ProcessOrder(new CardGame.Order_Score());
     Program.gameVue = Program.Game.GetVue();
     Program.DisplayPlayState();
 }