Ejemplo n.º 1
0
 static void Main(string[] args)
 {
     model.Game g = new model.Game();
     view.IView v = new view.SimpleView(); //new view.SwedishView(); for Swedish
     controller.PlayGame ctrl = new controller.PlayGame(v);
     g.Register(ctrl);
     while (ctrl.Play(g));
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            model.Game g = new model.Game();
            view.IView v = new view.SwedishView();//new view.SimpleView();
            controller.PlayGame ctrl = new controller.PlayGame();

            while (ctrl.Play(g, v));
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            controller.PlayGame ctrl = new controller.PlayGame();

            while (ctrl.Play())
            {
                ;
            }
        }
Ejemplo n.º 4
0
 static void Main(string[] args)
 {
     view.IView          v    = new view.SimpleView(); // new view.SwedishView();
     controller.PlayGame ctrl = new controller.PlayGame(v);
     model.Game          g    = new model.Game(ctrl);
     while (ctrl.Play(g))
     {
         ;
     }
 }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            model.Game          g    = new model.Game();
            view.IView          v    = new view.SwedishView(); // new view.SwedishView();
            controller.PlayGame ctrl = new controller.PlayGame(v, g);

            while (ctrl.Play())
            {
                ;
            }
        }
Ejemplo n.º 6
0
 static void Main(string[] args)
 {
     model.Game          g    = new model.Game();
     view.IView          v    = /*new view.SimpleView(); */ new view.SwedishView();
     controller.PlayGame ctrl = new controller.PlayGame(g, v);
     g.subscribToCards(ctrl);
     while (ctrl.Play())
     {
         ;
     }
 }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            view.IView          v    = new view.SimpleView(); // new view.SwedishView();
            model.Game          g    = new model.Game((model.IExcitingObserver)v);
            controller.PlayGame ctrl = new controller.PlayGame();

            while (ctrl.Play(g, v))
            {
                ;
            }
        }
Ejemplo n.º 8
0
        static void Main(string[] args)
        {
            model.Game g = new model.Game();
            view.IView v = new view.SimpleView(); // new view.SwedishView();
            controller.PlayGame ctrl = new controller.PlayGame();

            //Register controller as listener to the card add
            g.SubscribeToCardAdds(ctrl);

            while (ctrl.Play(g, v));
        }
Ejemplo n.º 9
0
        static void Main(string[] args)
        {
            // TESTAR....
            model.Game          g    = new model.Game();
            view.IView          v    = new view.SimpleView(); // new view.SwedishView();
            controller.PlayGame ctrl = new controller.PlayGame(g, v);

            while (ctrl.Play())
            {
                ;
            }
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            model.Game          g    = new model.Game();
            view.IView          v    = new view.SwedishView();
            controller.PlayGame ctrl = new controller.PlayGame(g, v);

            g.RegisterSubscriber(ctrl);
            while (ctrl.Play())
            {
                ;
            }
        }
Ejemplo n.º 11
0
        static void Main(string[] args)
        {
            model.Game g = new model.Game();
            view.IView v = new view.ConsoleView(); // new view.ConsoleView("S");

            controller.PlayGame ctrl = new controller.PlayGame(g, v);

            while (ctrl.Play())
            {
                ;
            }
        }
Ejemplo n.º 12
0
        static void Main(string[] args)
        {
            model.Game game = new model.Game();
            var swedishView = false;
            view.IView view;
            if (swedishView)
                view = new view.SwedishView();
            else
                view = new view.SimpleView();
            controller.PlayGame ctrl = new controller.PlayGame(game, view);

            while (ctrl.Play());
        }
Ejemplo n.º 13
0
        static void Main(string[] args)
        {
            model.rules.AbstractRulesFactory ruleSet = new model.rules.EasyRulesFactory();
            //model.rules.AbstractRulesFactory ruleSet = new model.rules.HardRulesFactory();

            model.Game g = new model.Game(ruleSet);
            view.IView v = new view.SwedishView();//new view.SimpleView();
            controller.PlayGame ctrl = new controller.PlayGame();

            g.Subscribe(ctrl);

            while (ctrl.Play(g, v));
        }
Ejemplo n.º 14
0
        static void Main(string[] args)
        {
            model.Game g = new model.Game();// // ändrat til CardObserver
            view.IView v = new view.SimpleView(); // new view.SwedishView();
            controller.PlayGame ctrl = new controller.PlayGame(g, v); // ändrat

            g.SetPlayerObserver(ctrl);

            while (ctrl.Play()) ;// ändrat

            /*controller.PlayGame ctrl = new controller.PlayGame();
            while (ctrl.Play(g, v));*/
        }
Ejemplo n.º 15
0
        static void Main(string[] args)
        {
            model.Game          g    = new model.Game();
            view.IView          v    = new view.SimpleView(); // new view.SwedishView();
            controller.PlayGame ctrl = new controller.PlayGame();

            g.SubscriptionToNewCards(ctrl);

            while (ctrl.Play(g, v))
            {
                ;
            }
        }
Ejemplo n.º 16
0
        static void Main(string[] args)
        {
            model.Game          g    = new model.Game();
            view.IView          v    = new view.SwedishView();//new view.SimpleView();
            controller.PlayGame ctrl = new controller.PlayGame();

            g.setPlayerListener(ctrl);

            while (ctrl.Play(g, v))
            {
                ;
            }
        }
Ejemplo n.º 17
0
        private static void InitializeApp()
        {
            model.Game                   g    = new model.Game();
            view.IView                   v    = new view.SimpleView(); // new view.SwedishView();
            controller.PlayGame          ctrl = new controller.PlayGame();
            controller.DealtCardObserver o    =
                new controller.DealtCardObserver(g, v);

            while (ctrl.Play(g, v, o))
            {
                ;
            }
        }
Ejemplo n.º 18
0
        static void Main(string[] args)
        {
            view.IView          v        = new view.SimpleView();
            controller.PlayGame ctrl     = new controller.PlayGame();
            model.Dealer        m_dealer = new model.Dealer(new model.rules.RulesFactory());
            m_dealer.SubscriberList += ctrl.HandleEvent;

            model.Game g = new model.Game(m_dealer);

            while (ctrl.Play(g, v))
            {
                ;
            }
        }
Ejemplo n.º 19
0
        static void Main(string[] args)
        {
            model.Dealer        d    = new model.Dealer(new model.rules.RulesFactory(), "Croupier");
            model.Player        p    = new model.Player("Player");
            model.Game          g    = new model.Game(d, p);
            view.IView          v    = new view.SwedishView();//new view.SimpleView();
            controller.PlayGame ctrl = new controller.PlayGame(v, g);

            d.Register(ctrl);

            while (ctrl.Play())
            {
                ;
            }
        }
Ejemplo n.º 20
0
        static void Main(string[] args)
        {
            view.IView            v            = new view.SwedishView();//new view.SimpleView();
            controller.PlayGame   ctrl         = new controller.PlayGame();
            List <model.Observer> observerList = new List <model.Observer>();

            observerList.Add(ctrl);
            model.Game g = new model.Game(observerList);


            while (ctrl.Play(g, v))
            {
                ;
            }
        }
Ejemplo n.º 21
0
        static void Main(string[] args)
        {
            model.Game g = new model.Game();
            view.IView v = new view.SimpleView(); // new view.SwedishView();

            model.IObserver co = new controller.CardObserver(g, v);
            g.AddCardObserver(co);

            controller.PlayGame ctrl = new controller.PlayGame();

            while (ctrl.Play(g, v))
            {
                ;
            }
        }
Ejemplo n.º 22
0
 static void Main(string[] args)
 {
     model.Game          g    = new model.Game();
     view.IView          v    = new view.SwedishView();
     controller.PlayGame ctrl = new controller.PlayGame();
     try
     {
         while (ctrl.Play(g, v))
         {
             ;
         }
     }
     catch (Exception Ex)
     {
         WriteLine($"Something's gone horribly wrong!: {Ex.Message}");
     }
 }
        const bool c_runConsoleBased = false; //need to change output type in application (project) settings as well

        #endregion Fields

        #region Methods

        static void Main(string[] args)
        {
            model.rules.IRulesFactory rulesFactory = new model.rules.AmericanRulesFactory();
            model.Game g = new model.Game(rulesFactory);

            if (c_runConsoleBased)
            {
                view.IView v = new view.SwedishView(); // new view.SwedishView();
                controller.PlayGame ctrl = new controller.PlayGame(g, v);
                while (ctrl.Play());
            }
            else
            {
                BlackJack.view.FormView form = new BlackJack.view.FormView();
                view.IView v = form; // new view.SwedishView();
                controller.PlayGame ctrl = new controller.PlayGame(g, v);
                ctrl.Play();

                Application.Run(form);
            }
        }
Ejemplo n.º 24
0
        static void Main(string[] args)
        {
            controller.PlayGame ctrl = new controller.PlayGame();

            while (ctrl.Play());
        }