Beispiel #1
0
 public PlayGame(model.Game a_game, view.IView a_view)
 {
     m_game = a_game;
     m_view = a_view;
     m_view.DisplayWelcomeMessage();
     m_game.Subsribe(this);
 }
Beispiel #2
0
        public bool Play(model.Game a_game, view.IView a_view)
        {
            m_view = a_view;
            m_game = a_game;
            a_view.DisplayWelcomeMessage();

            a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore());
            a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore());

            if (a_game.IsGameOver())
            {
                a_view.DisplayGameOver(a_game.IsDealerWinner());
            }

            BlackJack.view.Events input = (BlackJack.view.Events)a_view.GetInput();

            if (input == view.Events.Play)
            {
                a_game.NewGame();
            }
            else if (input == view.Events.Hit)
            {
                a_game.Hit();
            }
            else if (input == view.Events.Stand)
            {
                a_game.Stand();
            }

            return input != view.Events.Quit;
        }
Beispiel #3
0
        public PlayGame(model.Game a_game, view.IView a_view)
        {
            this.a_game = a_game;
            this.m_view = a_view;

            a_game.AddSubscriber(this);
        }
Beispiel #4
0
        public bool PlayGame(view.Console a_view, model.GameFacade a_game)
        {
            a_view.PresentInstructions();
            a_view.DisplayHands(a_game.GetDealerHand(), a_game.GetDealerScore(), a_game.GetPlayerHand(), a_game.GetPlayerScore());
            if (a_game.IsGameOver())
            {
                a_view.DisplayWinner(a_game.IsPlayerWinner());
            }

            view.Console.Event e;

            e = a_view.GetEvent();
            if (e == view.Console.Event.Quit)
            {
                return false;
            }
            if (e == view.Console.Event.Start)
            {
                a_game.StartNewRound();

            }
            if (e == view.Console.Event.Hit)
            {
                a_game.Hit();
            }
            if (e == view.Console.Event.Stand)
            {
                a_game.Stand();
            }

            return true;
        }
Beispiel #5
0
     : super()
 {
     // without including Calendar Folder permissions.
     //
     this.receiveCopiesOfMeetingMessages = false;
     this.view /* private */ Items       = false;
 }
Beispiel #6
0
        public bool Play(model.Game a_game, view.IView a_view)
        {
            a_view.DisplayWelcomeMessage();
            a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore());
            a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore());

            if (a_game.IsGameOver())
            {
                a_view.DisplayGameOver(a_game.IsDealerWinner());
            }

            //int input = a_view.GetInput(); removed due to hidden depencendy.
            int input = System.Console.In.Read();

            if (input == 'p')
            {
                a_game.NewGame();
            }
            else if (input == 'h')
            {
                a_game.Hit();
            }
            else if (input == 's')
            {
                a_game.Stand();
            }

            return input != 'q';
        }
Beispiel #7
0
        public PlayGame(model.Game a_game, view.IView a_view)
        {
            m_game = a_game;
            m_view = a_view;

            m_game.AddObserver(this);
        }
Beispiel #8
0
 public PlayGame(model.Game A_game,
     view.IView A_view)
 {
     a_game = A_game;
       a_view = A_view;
       a_game.addSub(this);
 }
Beispiel #9
0
        public bool Play(model.Game a_game, view.IView a_view)
        {
            a_view.DisplayWelcomeMessage();

            a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore());
            a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore());

            if (a_game.IsGameOver())
            {
                a_view.DisplayGameOver(a_game.IsDealerWinner());
            }

            int input = a_view.GetInput();

            if (input == 'p')
            {
                a_game.NewGame();
            }
            else if (input == 'h')
            {
                a_game.Hit();
            }
            else if (input == 's')
            {
                a_game.Stand();
            }

            return input != 'q';
        }
        public bool Play(model.Game a_game, view.IView a_view)
        {
            //Initialize fields
            m_view = a_view;
            m_game = a_game;

            a_view.DisplayWelcomeMessage();

            a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore());
            a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore());

            if (a_game.IsGameOver())
            {
                a_view.DisplayGameOver(a_game.IsDealerWinner());
            }

            view.Input input = a_view.GetInput();

            if (input == view.Input.Play)
            {
                a_game.NewGame();
            }
            else if (input == view.Input.Hit)
            {
                a_game.Hit();
            }
            else if (input == view.Input.Stand)
            {
                a_game.Stand();
            }

            return input != view.Input.Quit;
        }
Beispiel #11
0
        public void switchView(view p)
        {
            currentObject.SetActive(false);
            currentView.setActive(false);
            switch (p)
            {
            case view.mcu:
                currentObject = mcu;
                currentView   = mcuView;
                break;

            case view.sinRozamiento:
                currentObject = sinRozamientoObject;
                currentView   = sinRozamientoView;
                break;

            case view.conRozamientoVMin:
                currentObject = vMinObject;
                currentView   = vMinView;
                break;

            case view.conRozamientoVMax:
                currentObject = vMaxObject;
                currentView   = vMaxView;
                break;

            default:
                Debug.LogError("Error: tipo de vista no reconocido por switch");
                break;
            }
            currentObject.SetActive(true);
            currentView.setActive(true);
        }
Beispiel #12
0
 public PlayGame(model.Game g, view.IView v)
 {
     a_game = g;
     a_view = v;
     a_view.DisplayWelcomeMessage();
     a_game.Subscribe(this);
 }
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            l_views.Add(new view
            {
                date   = Convert.ToDateTime(date.Text).ToShortDateString(),
                otzyv  = otzyv.Text,
                ozenka = ozenka.Ozenka
            });
            view             new_view   = l_views[l_views.Count - 1];
            string           sql        = "insert into Просмотры (Дата,Отзыв,Оценка,[id фильма]) values(@date,@otzyv,@ozenka,@id)";
            List <parameter> parameters = new List <parameter>();

            parameters.Add(new parameter {
                name = "@date", value = Convert.ToDateTime(new_view.date)
            });
            parameters.Add(new parameter {
                name = "@otzyv", value = new_view.otzyv
            });
            parameters.Add(new parameter {
                name = "@ozenka", value = new_view.ozenka
            });
            parameters.Add(new parameter {
                name = "@id", value = id
            });
            DataBase.exec_zapros(sql, parameters);
            dates.Items.Refresh();
            dates.SelectedIndex = l_views.Count - 1;
            date.Visibility     = Visibility.Hidden;
            save.Visibility     = Visibility.Hidden;
            cancel.Visibility   = Visibility.Hidden;
            ozenka.Available    = false;
            update_selection(selected_item);
            otzyv.IsEnabled = false;
            (this.Owner as MainWindow).update_views(id);
        }
Beispiel #14
0
    bool TryReadElementFromXml(EwsServiceXmlReader reader)
    {
        switch (reader.LocalName)
        {
        case XmlElementNames.UserId:
            this.userId = new UserId();
            this.userId.LoadFromXml(reader, reader.LocalName);
            return(true);

        case XmlElementNames.DelegatePermissions:
            this.permissions.Reset();
            this.permissions.LoadFromXml(reader, reader.LocalName);
            return(true);

        case XmlElementNames.ReceiveCopiesOfMeetingMessages:
            this.receiveCopiesOfMeetingMessages = reader.ReadElementValue <bool>();
            return(true);

        case XmlElementNames.View /* private */ Items:
            this.view /* private */ Items = reader.ReadElementValue <bool>();
            return(true);

        default:
            return(false);
        }
    }
Beispiel #15
0
        internal void GoBack()
        {
            if (View == view.Explorer)
            {
                if (OpenedNode.ParentName != null && OpenedNode.ParentName != "")
                {
                    nodetitle.RemoveName(OpenedNode.DisplayName, OpenedNode.Name);
                    Node n = OpenedNode;
                    if (OpenedNode.Name != ParentNodeName)
                    {
                        OpenedNode.Destroy();
                    }

                    OpenedNode = GetNodeFromName(n.ParentName, true);
                    OpenedNode.SelectNode(n);

                    OpenedNode.SetRectangles();
                    OpenedNode.UpdateShiftIndex();
                }
            }
            else if (View == view.FullImage)
            {
                View = view.Explorer;
            }
        }
Beispiel #16
0
 public Controller(view.MainView cV, view.MemberView mV, view.MemberListView mlV, view.BoatView bV, view.BoatListView bLV)
 {
     MainView = cV;
     MemberView = mV;
     MemberListView = mlV;
     BoatView = bV;
     BoatListView = bLV;
 }
Beispiel #17
0
        private List <View_Selector> GetSingleViewClasses(string viewPath)
        {
            view viewObj = db.views.FirstOrDefault(x => x.Path == viewPath);
            List <View_Selector> classesList = new List <View_Selector>();

            classesList.AddRange(db.View_Selectors.Where(x => x.ViewId == viewObj.Id));
            return(classesList);
        }
        public PlayGame(view.IView a_view, model.Game a_game)
        {
            m_view = a_view;
            m_game = a_game;

            // Subscribe to observer
            m_game.AddSubscribtionToCards(this);
        }
Beispiel #19
0
 //List<BlackJackObserver> m_observers;
 // Constructor
 public Game(view.IView view)
 {
     m_dealer = new Dealer(new rules.RulesFactory());
     m_player = new Player();
     view.AddSubscribers(m_dealer);
     view.AddSubscribers(m_player);
     //m_observers = new List<BlackJackObserver>();
 }
Beispiel #20
0
 public DateController(view.MainForm form)
 {
     this.form = form;
     FetchCurrentDate();
     timer = new System.Timers.Timer(1000);
     timer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimeOut);
     timer.AutoReset = true;
     timer.Start();
 }
        public PlayGame(model.Game a_game, view.IView a_view)
        {
            m_game = a_game;
            m_view = a_view;

            //subscribe to game events
            m_game.AddSubscriber(this);

            UpdateView();
        }
Beispiel #22
0
    public void Focus(Transform new_target)
    {
        view new_view = new view();

        new_view.transform = new_target;
        new_view.size      = views[0].size;
        views[0]           = new_view;
        //Debug.Log("new character focus");
        stop_waiting = wait_time + Time.realtimeSinceStartup;
    }
    public void RequestChildFocus2(View child, View focused)
    {
        if (_clearFocused != null)
        {
            _clearFocused.ClearFocus();
        }

        _clearFocused = focused;
        base.RequestChildFocus(child, focused);
    }
Beispiel #24
0
    public void Focus(Transform new_target, float height)
    {
        view new_view = new view();

        new_view.transform = new_target;
        new_view.size      = height / 2;
        views.Add(new_view);
        //Debug.Log(views.Count);
        stop_waiting = wait_time + Time.realtimeSinceStartup;
    }
 private void Add_view_Click(object sender, RoutedEventArgs e)
 {
     selected_item     = dates.SelectedItem as view;
     date.Visibility   = Visibility.Visible;
     save.Visibility   = Visibility.Visible;
     cancel.Visibility = Visibility.Visible;
     otzyv.IsEnabled   = true;
     otzyv.Text        = "";
     ozenka.Ozenka     = 0;
     ozenka.Available  = true;
 }
Beispiel #26
0
    IEnumerator cinematic(GameObject focalPoint)
    {
        view new_view = new view();

        new_view.transform = focalPoint.transform;
        new_view.size      = focalPoint.transform.localScale.y / 2;
        views.Add(new_view);
        yield return(new WaitForSeconds(cinematicTime));

        RemoveView(focalPoint.transform);
    }
 private void update_selection(view view)
 {
     if (view != null)
     {
         otzyv.Text       = view.otzyv;
         ozenka.Available = false;
         ozenka.S_Height  = 46;
         ozenka.S_Width   = 55.2;
         ozenka.Ozenka    = view.ozenka;
     }
 }
Beispiel #28
0
 public mainFrm()
 {
     InitializeComponent();
     this.pnlOptions.Hide();
     this.pnlHighscores.Hide();
     this.cmbBoxHighscores.SelectedIndex = 0;
     this.cmbBoxTheme.SelectedIndex      = 0;
     this.cmbBxDifficulty.SelectedIndex  = 0;
     this.chkBxDlHighscores.Checked      = true;
     activeView = view.none;
 }
Beispiel #29
0
 private void btnHighscores_Click(object sender, EventArgs e)
 {
     if (activeView == view.options)
     {
         pnlOptions.Hide();
     }
     this.pnlHighscores.Location = new Point(299, 69);
     this.pnlHighscores.Size = new Size(481, 446);
     this.pnlHighscores.Show();
     this.activeView = view.highscores;
 }
Beispiel #30
0
 private void btnHighscores_Click(object sender, EventArgs e)
 {
     if (activeView == view.options)
     {
         pnlOptions.Hide();
     }
     this.pnlHighscores.Location = new Point(299, 69);
     this.pnlHighscores.Size     = new Size(481, 446);
     this.pnlHighscores.Show();
     this.activeView = view.highscores;
 }
Beispiel #31
0
 public mainFrm()
 {
     InitializeComponent();
     this.pnlOptions.Hide();
     this.pnlHighscores.Hide();
     this.cmbBoxHighscores.SelectedIndex = 0;
     this.cmbBoxTheme.SelectedIndex = 0;
     this.cmbBxDifficulty.SelectedIndex = 0;
     this.chkBxDlHighscores.Checked = true;
     activeView = view.none;
 }
Beispiel #32
0
        public void PlayGame(model.DiceGame a_game, view.Console a_view)
        {
            a_view.DisplayInstructions();

            while (a_view.WantsToPlay())
            {
                a_view.DisplayInstructions();

                a_view.DisplayResult(a_game.Play(), a_game.GetDice1Value(), a_game.GetDice2Value());

            }
        }
        public PlayGame(model.Game a_game, view.IView a_view)
        {
            m_game = a_game;
            m_view = a_view;

            //subscribe to game events
            m_game.AddSubscriber(this);

            if (!(m_view is view.ModernView))
            {
                ClearView();
            }
        }
    void Start()
    {
        c      = new controller();
        v      = new view();
        render = new RendertoViewcommand();
        add    = new AddGoodscommand();

        //	Packageview packageview =
        //THIS IS MORE VIEW BE WRITTER

        AdjustView(new Packageview());
        AdjustCommand("RendertoViewcommand", render);
        AdjustCommand("AddGoodscommand", add);
    }
Beispiel #35
0
    void init()
    {
        c                 = new controller();
        v                 = new view();
        render            = new RendertoViewcommand();
        add               = new AddGoodscommand();
        once              = new Oncesessioncommand();
        task              = new AddTaskcommand();
        rtask             = new RenderTaskcommand();
        input             = new InputFieldcommand();
        boolCommend       = new BoolCommend();
        stringCommand     = new StringCommand();
        lightImageCommand = new LightImageCommand();
        studentCommand    = new Studentcommand();
        playerCommand     = new PlayerCommand();
        //	Packageview packageview =
        //THIS IS MORE VIEW BE WRITTER

        AdjustView(new Packageview());
        AdjustView(new dialogview());
        AdjustView(new taskview());
        AdjustView(new Studentview());
        AdjustCommand("once", once);
        AdjustCommand("RendertoViewcommand", render);
        AdjustCommand(Cmd.addItem, add);
        // later will be add delete task
        AdjustCommand("addtask", task);
        AdjustCommand("rtask", rtask);

        //Tip的操作
        tip = new TipTaskcommand();
        AdjustCommand(Cmd.showTip, tip);
        colorcommand = new Colorcommand();
        AdjustCommand(Cmd.showColor, colorcommand);
        AdjustCommand(Cmd.ShowImageAndText, input);
        AdjustCommand(Cmd.changeColor, input);
        AdjustCommand(Cmd.ChangeBool, boolCommend);
        AdjustCommand(Cmd.ChangeString, stringCommand);
        AdjustCommand(Cmd.ChangeColorInImage, lightImageCommand);
        AdjustCommand(Cmd.DeleteMinScore, studentCommand);
        AdjustCommand(Cmd.ShowStudentInformtion, studentCommand);
        AdjustCommand(Cmd.ShowMajorColor, studentCommand);
        AdjustCommand(Cmd.GetStudentModel, studentCommand);
        AdjustCommand(Cmd.ImproveAttack, playerCommand);
        //List<PlayerRoleInfo> playerInfo =  ArchiveManager.Instance.GetSamplelist<PlayerRoleInfo>();
        //Log(playerInfo[0].Attack);
        //PlayerRoleInfo player1 = ArchiveManager.Instance.GetSampleInIndex<PlayerRoleInfo>(0);
        //Debug.Log(player1.BreathingRate);
    }
Beispiel #36
0
        public void RegisterMember(model.Member a_member, view.Console a_view, model.Menu a_menu)
        {
            a_member.name = a_view.RegisterName();
                a_member.personalIdentityNumber = a_view.RegisterPersonalIdentityNumber();

                using (StreamWriter writer = new StreamWriter("memberRegister.txt", true))
                {
                    a_member.id++;
                    writer.WriteLine(a_member.id + "\t" + a_member.name + "\t" + a_member.personalIdentityNumber);
                    writer.Close();
                    a_view.ConfirmChange("Member registered: " + "Id: " + a_member.id + ", Name: " + a_member.name + ", Personal identity number: " + a_member.personalIdentityNumber);

                    a_menu.ChooseFromMenu(a_member, a_menu);
                }
        }
Beispiel #37
0
        private void OpenNodeOrEntity()
        {
            if (OpenedNode.SelectedIndexes != null && OpenedNode.SelectedIndexes.Count > 0)
            {
                if (OpenedNode.selection == Node.Selection.Entity)
                {
                    FullImage.LoadEntity(OpenedNode.GetSelectedEntity(), ActiveFolder);

                    View = view.FullImage;
                }
                else if (OpenedNode.selection == Node.Selection.Node)
                {
                    View = view.Explorer;
                    OpenNode(OpenedNode.GetSelectedNode());
                }
            }
        }
Beispiel #38
0
        public Cache(controller controller, view view, crudMode crudMode = crudMode.Stateless, BoatCatalog boatCatalog = null, MemberCatalog memberCatalog = null)
        {
            CachedController = controller;
            CachedView = view;
            CachedCrudMode = crudMode;
            CachedBoatCatalog = boatCatalog;
            CachedMemberCatalog = memberCatalog;

            if (boatCatalog == null)
            {
                throw new ApplicationException("Where´s boatcatalog? Nothing to use in the Constructor...");
            }
            if (memberCatalog == null)
            {
                throw new ApplicationException("Where´s boatcatalog? Nothing to use in the Constructor...");
            }
        }
Beispiel #39
0
 internal void ShowFavorite()
 {
     if (View != view.Explorer)
     {
         View   = view.Explorer;
         option = ExplorerOption.Recycle;
     }
     if (option != ExplorerOption.Favorite)
     {
         option = ExplorerOption.Favorite;
         OpenNode(Favorite);
     }
     else
     {
         option = ExplorerOption.Root;
         OpenNode(RootNode);
     }
 }
        public void DoControl(view.ConsoleView a_sv)
        {
            v_sv = a_sv;

            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.BackgroundColor = ConsoleColor.Black;

            // Test members for development
            // Remove before launch
            /*
            m_ml.CreateMember(m_ml.Members.Count() + 1000, "Dexter", "Morgan", "791103-4455");
            m_ml.CreateMember(m_ml.Members.Count() + 1000, "Joey", "Quinn", "750123-4455");
            m_ml.CreateMember(m_ml.Members.Count() + 1000, "Sergent", "Batista", "670130-4455");
            c_dc.UpdateDataStorage();
             */
            c_dc.UpdateMemberList();
            DoDisplayStart();
        }
    void init()
    {
        c                 = new controller();
        v                 = new view();
        render            = new RendertoViewcommand();
        add               = new AddGoodscommand();
        once              = new Oncesessioncommand();
        task              = new AddTaskcommand();
        rtask             = new RenderTaskcommand();
        input             = new InputFieldcommand();
        boolCommend       = new BoolCommend();
        stringCommand     = new StringCommand();
        lightImageCommand = new LightImageCommand();
        studentCommand    = new Studentcommand();
        //	Packageview packageview =
        //THIS IS MORE VIEW BE WRITTER

        AdjustView(new Packageview());
        AdjustView(new dialogview());
        AdjustView(new taskview());
        AdjustView(new Studentview());
        AdjustCommand("once", once);
        AdjustCommand("RendertoViewcommand", render);
        AdjustCommand(Cmd.addItem, add);
        // later will be add delete task
        AdjustCommand("addtask", task);
        AdjustCommand("rtask", rtask);

        //Tip的操作
        tip = new TipTaskcommand();
        AdjustCommand(Cmd.showTip, tip);
        colorcommand = new Colorcommand();
        AdjustCommand(Cmd.showColor, colorcommand);
        AdjustCommand(Cmd.ShowImageAndText, input);
        AdjustCommand(Cmd.changeColor, input);
        AdjustCommand(Cmd.ChangeBool, boolCommend);
        AdjustCommand(Cmd.ChangeString, stringCommand);
        AdjustCommand(Cmd.ChangeColorInImage, lightImageCommand);
        AdjustCommand(Cmd.DeleteMinScore, studentCommand);
        AdjustCommand(Cmd.ShowStudentInformtion, studentCommand);
        AdjustCommand(Cmd.ShowMajorColor, studentCommand);
        AdjustCommand(Cmd.GetStudentModel, studentCommand);
    }
Beispiel #42
0
        public bool PlayGame(view.Console a_view, model.Dealer a_dealer, model.Player a_player)
        {
            a_view.PresentInstructions();
            a_view.DisplayHands(a_dealer.GetHand(), a_player.GetHand());
            view.Console.Event e;

            e = a_view.GetEvent();
            if (e == view.Console.Event.Quit)
            {
                return false;
            }
            if (e == view.Console.Event.Start)
            {
                a_dealer.StartNewRound(a_player);

            }

            return true;
        }
Beispiel #43
0
 internal void OpenRecycleBin()
 {
     if (View != view.Explorer)
     {
         View   = view.Explorer;
         option = ExplorerOption.Recycle;
     }
     if (option == ExplorerOption.Root)
     {
         option    = ExplorerOption.Recycle;
         nodetitle = new NodeViewTitle(ActiveFolder);
         OpenNode(Recycle);
     }
     else
     {
         option    = ExplorerOption.Root;
         nodetitle = new NodeViewTitle(ActiveFolder);
         OpenNode(RootNode);
     }
 }
Beispiel #44
0
 void Awake()
 {
     if (instance == null)
     {
         instance = new view();
     }
     else
     {
         if (instance != this)
         {
             Destroy(gameObject);
         }
     }
     instance.gridGroup    = gridGroup;
     instance.blockBkColor = blockBkColor;
     instance.block        = loadAssetsBundle("block");
     instance.best         = best;
     instance.source       = source;
     DontDestroyOnLoad(gameObject);
 }
        //InputActionObserver method
        public void Input(view.InputAction inputAction)
        {
            if (inputAction == view.InputAction.Play)
            {
                ClearView();
                m_game.NewGame();
            }
            else if (inputAction == view.InputAction.Hit)
            {
                m_game.Hit();
            }
            else if (inputAction == view.InputAction.Stand)
            {
                m_game.Stand();
            }

            if (m_game.IsGameOver())
            {
                m_view.DisplayGameOver(m_game.IsDealerWinner());
            }
        }
Beispiel #46
0
        // GET: /ad/Details/5

        public ActionResult Details(int id = 0)
        {
            ad ad = db.ads.Find(id);

            Session["a"] = id;
            view add = db.views.Find(id);

            add.org = add.VId + 1;
            add.VId = add.org;


//          var userResults = from u in db.views
//                          where u.ad_id == id
            //
            //                select u.VId;

            //foreach (var a in userResults)
            //{


            //  int ab= (int)add.VId;



            //}



            db.Entry(add).State = EntityState.Modified;
            // db.views.Add(addd);
            db.SaveChanges();



            if (ad == null)
            {
                return(HttpNotFound());
            }
            return(View(ad));
        }
Beispiel #47
0
        public bool Play(model.Game a_game, view.IView a_view)
        {
            m_view = a_view;
            m_game = a_game;


            if (!isWelcomed)
            {
                isWelcomed = true;
                a_view.DisplayWelcomeMessage();
                m_view.DisplayRules(m_game.GetHitRule(), m_game.GetNewGameRule(), m_game.GetWinRule());
            }
            else { 
                a_view.DisplayResults(a_game.GetPlayerHand(), a_game.GetPlayerScore(), a_game.GetDealerHand(), a_game.GetDealerScore());
            }

            if (a_game.IsGameOver())
            {
                a_view.DisplayGameOver(a_game.IsDealerWinner());
            }

            view.Action action = a_view.GetInput();

            switch (action)
            {
                case view.Action.NewGame:
                    a_game.NewGame();
                    break;
                case view.Action.Hit:
                    a_game.Hit();
                    break;
                case view.Action.Stand:
                    a_game.Stand();
                    break;
            }

            return action != view.Action.Quit;

        }
Beispiel #48
0
    // Start is called before the first frame update
    void Awake()
    {
        if (bottomLeftBound.localPosition == topRightBound.localPosition)
        {
            Debug.LogError("Please set the bounds of the camera: " + gameObject);
        }

        camHeight = 2f * cam.orthographicSize;
        camWidth  = camHeight * cam.aspect;

        minX = bottomLeftBound.position.x;
        minY = bottomLeftBound.position.y;

        maxX = topRightBound.position.x;
        maxY = topRightBound.position.y;

        views = new List <view>();
        view main_view = new view();

        main_view.transform = main_target;
        main_view.size      = cam.orthographicSize;
        views.Add(main_view);
    }
Beispiel #49
0
        private void button5_Click(object sender, EventArgs e)
        {
            view f1 = new view();

            f1.Show();
        }
Beispiel #50
0
 //Set the view with a function:
 public void SetView(view theView)
 {
     view = theView;
 }
        private void Dates_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            view view = dates.SelectedItem as view;

            update_selection(view);
        }
Beispiel #52
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            HttpRequest request = context.Request;

            XHD.BLL.ssn_role     role  = new XHD.BLL.ssn_role();
            XHD.BLL.ssn_art_menu menu  = new XHD.BLL.ssn_art_menu();
            XHD.Model.ssn_role   model = new XHD.Model.ssn_role();
            XHD.BLL.ssn_visit    visit = new XHD.BLL.ssn_visit();
            XHD.BLL.ssn_art      art   = new XHD.BLL.ssn_art();
            var    cookie     = context.Request.Cookies[FormsAuthentication.FormsCookieName];
            var    ticket     = FormsAuthentication.Decrypt(cookie.Value);
            string CoockiesID = ticket.UserData;

            XHD.BLL.hr_employee emp = new XHD.BLL.hr_employee();
            int     emp_id          = int.Parse(CoockiesID);
            DataSet dsemp           = emp.GetList("id=" + emp_id);
            string  empname         = string.Empty;
            string  uid             = string.Empty;
            string  factory_Id      = string.Empty;

            if (dsemp != null && dsemp.Tables[0].Rows.Count > 0)
            {
                empname    = dsemp.Tables[0].Rows[0]["name"].ToString();
                uid        = dsemp.Tables[0].Rows[0]["uid"].ToString();
                factory_Id = dsemp.Tables[0].Rows[0]["Factory_Id"].ToString();
            }

            //角色保存
            if (request["Action"] == "SysSave")
            {
                model.RoleName    = PageValidate.InputText(request["T_role"], 250);
                model.RoleSort    = int.Parse(request["T_RoleOrder"]);
                model.RoleDscript = PageValidate.InputText(request["T_Descript"], 255);
                model.Factory_Id  = factory_Id;

                string id = PageValidate.InputText(request["id"], 50);

                if (!string.IsNullOrEmpty(id) && id != "null")
                {
                    DataSet ds = role.GetList("RoleID=" + int.Parse(id));
                    DataRow dr = ds.Tables[0].Rows[0];
                    model.RoleID     = int.Parse(id);
                    model.UpdateDate = DateTime.Now;
                    model.UpdateID   = emp_id;
                    role.Update(model);
                }
                else
                {
                    model.CreateID   = emp_id;
                    model.CreateDate = DateTime.Now;
                    int rid = role.Add(model);
                }
            }

            //验证是否唯一
            else if (request["Action"] == "Exist")
            {
                DataSet ds1 = role.GetList(" RoleName='" + XHD.Common.PageValidate.InputText(request["T_role"], 250) + "'" + " and factory_Id='" + factory_Id + "'");
                context.Response.Write(ds1.Tables[0].Rows.Count > 0 ? "false" : "true");
            }

            //获取角色表格json
            else if (request["Action"] == "grid")
            {
                DataSet ds = role.GetList(0, "factory_Id='" + factory_Id + "'", " RoleSort");

                string dt = XHD.Common.GetGridJSON.DataTableToJSON(ds.Tables[0]);

                context.Response.Write(dt);
            }

            //获取角色信息
            else if (request["Action"] == "form")
            {
                DataSet ds = role.GetList(" RoleID=" + int.Parse(request["id"]));

                string dt = XHD.Common.DataToJson.DataToJSON(ds);

                context.Response.Write(dt);
            }
            //删除角色
            else if (request["Action"] == "del")
            {
                string rid   = request["id"];
                bool   isdel = role.Delete(int.Parse(rid));
                if (isdel)
                {
                    context.Response.Write("true");
                }
                else
                {
                    context.Response.Write("false");
                }

                //角色下员工删除
                XHD.BLL.ssn_role_emp rm = new XHD.BLL.ssn_role_emp();
                rm.Delete("RoleID=" + int.Parse(rid));

                //角色下数据权限删除
                XHD.BLL.ssn_visit data_auth = new XHD.BLL.ssn_visit();
                data_auth.DeleteByRole(int.Parse(rid));

                //角色下功能权限删除
                XHD.BLL.ssn_authority auth = new XHD.BLL.ssn_authority();
                auth.DeleteWhere("Role_id=" + int.Parse(rid));
            }

            #region 权限设置
            //auth
            else if (request["Action"] == "treegrid")
            {
                string appidstr = request["appid"];
                int    appid    = int.Parse(appidstr);

                //获取单位
                string ftyid = PageValidate.InputText(request["factory_id"], 60);
                //设置查询条件
                string wheretext  = "App_id=" + appid; //限制menu
                string wheretext2 = "";                //限制button

                DataTable dt = menu.GetList(wheretext).Tables[0];
                dt.Columns.Add(new DataColumn("Sysroler", typeof(string)));

                XHD.BLL.ssn_button btn = new XHD.BLL.ssn_button();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataSet ds    = btn.GetList(0, "Menu_id=" + dt.Rows[i]["Menu_id"].ToString() + wheretext2, "Btn_order");
                    string  roler = "";
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
                        {
                            roler += ds.Tables[0].Rows[j]["Btn_id"].ToString() + "|" + ds.Tables[0].Rows[j]["Btn_name"].ToString();
                            roler += ",";
                        }
                    }
                    dt.Rows[i][dt.Columns.Count - 1] = roler;
                }
                string dt1 = "{Rows:[" + GetTasksString(0, dt) + "]}";
                context.Response.Write(dt1);
                context.Response.End();
            }
            //get auth
            else if (request["Action"] == "getauth")
            {
                string postdata           = Convert.ToString(HttpContext.Current.Request.QueryString["postdata"]);
                JavaScriptSerializer json = new JavaScriptSerializer();
                save sa = json.Deserialize <save>(postdata);
                XHD.Model.ssn_authority modelauth = new XHD.Model.ssn_authority();
                modelauth.Role_id    = int.Parse(sa.role_id);
                modelauth.App_ids    = sa.app;
                modelauth.Menu_ids   = sa.menu;
                modelauth.Button_ids = sa.btn;

                XHD.BLL.ssn_authority sysau = new XHD.BLL.ssn_authority();

                string  roledata = "0|0";
                DataSet ds       = sysau.GetList("Role_id=" + modelauth.Role_id + " and App_ids='" + modelauth.App_ids + "'");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DataRow dr = ds.Tables[0].Rows[0];
                    roledata = dr["Menu_ids"] + "|" + dr["Button_ids"];
                }
                context.Response.Write(roledata);
            }
            // save auth
            else if (request["Action"] == "saveauth")
            {
                string postdata           = Convert.ToString(HttpContext.Current.Request.QueryString["postdata"]);
                JavaScriptSerializer json = new JavaScriptSerializer();
                save sa = json.Deserialize <save>(postdata);
                XHD.Model.ssn_authority modelauth = new XHD.Model.ssn_authority();
                modelauth.Role_id    = int.Parse(sa.role_id);
                modelauth.App_ids    = PageValidate.InputText(sa.app, 50);
                modelauth.Menu_ids   = PageValidate.InputText(sa.menu, int.MaxValue);
                modelauth.Button_ids = PageValidate.InputText(sa.btn, int.MaxValue);
                modelauth.Factory_Id = factory_Id;

                XHD.BLL.ssn_authority sysau = new XHD.BLL.ssn_authority();
                //List<string> relstbtn = new List<string>();

                if (!string.IsNullOrEmpty(postdata))
                {
                    //给角色分配权限
                    sysau.DeleteWhere("Role_id=" + modelauth.Role_id + " and App_ids='" + modelauth.App_ids + "'");
                    if (modelauth.Menu_ids != "" || modelauth.Button_ids != ",,")
                    {
                        sysau.Add(modelauth);
                    }
                    context.Response.Write("{sucess:sucess}");
                }
            }
            #endregion

            #region 查看权限设置
            //菜单显示
            else if (request["Action"] == "menuList")
            {
                string appid   = request["appid"];
                string authtxt = PageValidate.InputText(request["auth"], 50);

                if (!string.IsNullOrEmpty(appid))
                {
                    string serchtxt = " App_id=" + int.Parse(appid);
                    //-context.Response.Write(authtxt);
                    DataSet       ds  = menu.GetList(0, serchtxt, " Menu_order");
                    StringBuilder str = new StringBuilder();
                    str.Append("[");
                    str.Append(GetTreeString(0, ds.Tables[0], authtxt));
                    str.Replace(",", "", str.Length - 1, 1);
                    str.Append("]");
                    context.Response.Write(str);
                }
            }

            //显示菜单下的文章
            else if (request["Action"] == "viewgrid")
            {
                //通过菜单id获取旗下的文章
                string menuid = request["menuid"];

                if (!string.IsNullOrEmpty(menuid))
                {
                    string  serchtxt = " Factory_Id='" + factory_Id + "' and Art_Menu_Id=" + int.Parse(menuid) + " and is_del=0 ";
                    DataSet ds       = art.GetList(serchtxt);

                    string dt = XHD.Common.GetGridJSON.DataTableToJSON(ds.Tables[0]);
                    context.Response.Write(dt);
                }
            }

            //保存查看权限
            else if (request["Action"] == "saveview")
            {
                string postdata           = Convert.ToString(HttpContext.Current.Request.QueryString["postdata"]);
                JavaScriptSerializer json = new JavaScriptSerializer();
                view sa = json.Deserialize <view>(postdata);
                XHD.Model.ssn_visit modelview = new XHD.Model.ssn_visit();
                modelview.Role_id     = int.Parse(sa.role_id);
                modelview.App_ids     = PageValidate.InputText(sa.app, 50);
                modelview.Menu_ids    = PageValidate.InputText(sa.menu, int.MaxValue);
                modelview.Art_id      = PageValidate.InputText(sa.art, int.MaxValue);
                modelview.Factory_Id  = factory_Id;
                modelview.Create_id   = emp_id;
                modelview.Create_date = DateTime.Now;

                if (!string.IsNullOrEmpty(postdata))
                {
                    //给角色分配权限
                    visit.DeleteWhere("Role_id=" + modelview.Role_id + " and Menu_ids='" + modelview.Menu_ids + "'");
                    if (modelview.Art_id != "")
                    {
                        visit.Add(modelview);
                    }
                    context.Response.Write("{sucess:sucess}");
                }
            }
            //获取当前角色的权限
            else if (request["Action"] == "getview")
            {
                string postdata           = Convert.ToString(HttpContext.Current.Request.QueryString["postdata"]);
                JavaScriptSerializer json = new JavaScriptSerializer();
                view sa = json.Deserialize <view>(postdata);
                XHD.Model.ssn_visit modelview = new XHD.Model.ssn_visit();
                modelview.Role_id  = int.Parse(sa.role_id);
                modelview.App_ids  = sa.app;
                modelview.Menu_ids = sa.menu;
                modelview.Art_id   = sa.art;

                string  roledata = "";
                DataSet ds       = visit.GetList("Role_id=" + modelview.Role_id + " and Menu_ids='" + modelview.Menu_ids + "'");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DataRow dr = ds.Tables[0].Rows[0];
                    roledata = dr["Art_id"].ToString();
                }
                context.Response.Write(roledata);
            }

            #endregion
        }
Beispiel #53
0
 void Awake()
 {
     isReceiveMesege = false;
     instance        = this;
 }
 public IInputContext CreateInput(IView view) => new SdlInputContext
 (
     view as SdlView ?? throw new InvalidOperationException
 public PlayGame(model.Game a_game, view.IView a_view)
 {
     m_game = a_game;
     m_view = a_view;
     m_game.DealNewCard(this);
 }
Beispiel #56
0
        private FileSystemWatcher FolderCheck()
        {
            System.IO.FileSystemWatcher watcher = new System.IO.FileSystemWatcher();

            watcher.Path = path;
            //확인할 경로

            watcher.NotifyFilter = NotifyFilters.FileName | NotifyFilters.DirectoryName | NotifyFilters.LastWrite;
            watcher.Filter = "";

            watcher.Created += new FileSystemEventHandler(Created);
            watcher.Deleted += new FileSystemEventHandler(Deleted);
            watcher.EnableRaisingEvents = true;
            view_event += new view(Form1_view_event);

            return watcher;
        }
Beispiel #57
0
 public PlayGame(model.Game a_Game, view.IView a_View)
 {
     a_game = a_Game;
     a_view = a_View;
     a_game.AddSub(this);
 }
Beispiel #58
0
        public ActionResult Create(ad ad)
        {
            ///////// Module for not Posting the add again and again////////////////

            /*if (ModelState.IsValid)
             * {
             *
             *
             *  using (BSEntities8 da = new BSEntities8())
             *  {
             *
             *      var ab = da.ads.Where(a => a.catagory.Equals(ad.catagory) && a.description.Equals(ad.description) && a.title.Equals(ad.title)).FirstOrDefault();
             *
             *      if (ab != null)
             *      {
             *         // ModelState.AddModelError("", "The Ad You have entered is already submitted thanks for anticipation");
             *
             *          Session["error"] = "The Ad Youhave submitted is already On Paksell thanks for the Anticipation";
             *          Redirect("ad/create");
             *
             *
             *
             *      }
             *
             *
             *  }
             *
             * }
             *
             *
             */



            var Data = db.ads.Add(ad);

            Data.ad_id       = ad.ad_id;
            Data.area_id     = ad.area_id;
            Data.catagory    = ad.catagory;
            Data.cityId      = ad.cityId;
            Data.date        = DateTime.Now;
            Data.description = ad.description;
            Data.title       = ad.title;
            Data.phone       = ad.phone;
            Data.e_mail      = ad.e_mail;
            Data.name        = ad.name;



            int i = 0;

            foreach (string file in Request.Files)
            {
                HttpPostedFileBase hpf = Request.Files[file] as HttpPostedFileBase;


                var validImageTypes = new string[]
                {
                    "image/gif",
                    "image/jpeg",
                    "image/pjpeg",
                    "image/png"
                };



                if (hpf.ContentLength == 0)
                {
                    continue;
                }

                string saveFileName = Path.GetFileName(hpf.FileName);
                string location     = Path.Combine(Server.MapPath("~/Images/" + @"\" + saveFileName));
                Request.Files[file].SaveAs(location);

                if (i >= 2)
                {
                    i = 0;
                }
                // Count + 1 each time
                i++;

                if (i == 1)
                {
                    Data.url1 = saveFileName;
                }

                else if (i == 2)
                {
                    Data.url3 = saveFileName;
                }
            }



            if (ModelState.IsValid)
            {
                using (BSEntities8 da = new BSEntities8())

                {
                    var ab = da.ads.Where(a => a.catagory.Equals(ad.catagory) && a.description.Equals(ad.description) && a.title.Equals(ad.title)).FirstOrDefault();

                    if (ab != null)
                    {
                        ModelState.AddModelError("", "The Ad You have entered is already submitted thanks for anticipation");

                        Redirect("ad/create");
                    }
                }


                db.ads.Add(ad);


                view addd = new view();


                addd.ad_id = Data.ad_id;



                addd.VId = 0;

                db.views.Add(addd);


                db.SaveChanges();
                using (BSEntities8 dc = new BSEntities8())
                {
                    if (dc.Iusers != null)
                    {
                        foreach (var v in dc.Iusers)
                        {
                            var s = dc.Iusers.Where(a => a.Scat.Equals(Data.catagory) && a.Sitem.Equals(Data.title)).FirstOrDefault();
                            {
                                if (s != null)
                                {
                                    string cat     = s.Scat;
                                    string item    = s.Sitem;
                                    string Area    = s.area;
                                    string phone   = Data.phone;
                                    string message = "Your intrested item posted cat is " + cat + "and item is:" + item + "and the cell number is" + phone + "This is from City" + Area;

                                    var twilio = new TwilioRestClient("ACfb4f763d08b8e11d5f5937fc052a6464", "c97a3b969fd6fe2bdc8f83fa61f3f465");
                                    var call   = twilio.InitiateOutboundCall("+1555456790", "+15551112222", "http://example.com/handleCall");

                                    var msg = twilio.SendMessage("+14843027060", "+923237575485", message);
                                }
                            }
                        }
                    }
                }


                return(RedirectToAction("Index"));
            }

            ViewBag.area_id = new SelectList(db.areas, "area_id", "name", ad.area_id);
            ViewBag.user_id = new SelectList(db.users, "user_id", "name", ad.user_id);
            ViewBag.cityId  = new SelectList(db.cities, "cityId", "cityName", ad.cityId);



            return(View(ad));
        }
Beispiel #59
0
 public Game(view.WinnerAtDraw winnerAtDraw, view.Soft17 soft17, view.GameRules gameRules)
 {
     m_dealer = new Dealer(new rules.RulesFactory( winnerAtDraw, soft17, gameRules));
     m_player = new Player();
 }
Beispiel #60
0
 public HandleBoats(view.BaseView baseView, view.BoatView boatView)
 {
     m_baseView = baseView;
     m_boatView = boatView;
 }