Пример #1
0
 public GUI()
 {
     InitializeComponent();
     CardCollection       = new Models.CardCollection();
     CardCollectionLoaded = false;
     loadPage.Interval    = new TimeSpan(0, 0, 0, 1, 0);
     loadPage.Tick       += LoadPage_Tick;
     com = new Communication();
     loadLogIn();
 }
Пример #2
0
        public GUICollection(GUIWindows.GUI parent_, Communication com_, Models.CardCollection CardCollection_)
        {
            InitializeComponent();

            logger = new Log.Logger();

            // attach parent
            parent = parent_;

            // attach controller
            ctrl = new Controllers.CollectionController(this, com_, CardCollection_);

            // init uninitialized data

            listDecksGUI       = new List <Models.DeckGUIModel>();
            listDeckContentGUI = new List <Models.DeckItemGUIModel>();
            selectedDeckID     = -1;
            editModeON         = false;

            // create an invisibile image that will become the zoomed in image whenever auser right clicks a card from the collection
            zoomedImage                     = new Image();
            zoomedImage.Width               = 250;
            zoomedImage.Height              = 346;
            zoomedImage.VerticalAlignment   = VerticalAlignment.Top;
            zoomedImage.HorizontalAlignment = HorizontalAlignment.Left;
            zoomedImage.Visibility          = Visibility.Hidden;
            zoomedImage.Stretch             = Stretch.Fill;
            grdParent.Children.Add(zoomedImage);

            // add all card images and attached buttons to two lists for easy access
            listGuiImages = new List <Image>()
            {
                cardImage1, cardImage2, cardImage3, cardImage4, cardImage5, cardImage6, cardImage7, cardImage8, cardImage9, cardImage10
            };
            listGuiCardButtons = new List <Button>()
            {
                btnCard1, btnCard2, btnCard3, btnCard4, btnCard5, btnCard6, btnCard7, btnCard8, btnCard9, btnCard10
            };

            // load the first 10 cards in the collection to GUI
            loadCardsToGUI(ctrl.filteredCollection, ctrl.currentIndex);

            // init server response timer
            checkServerResponse.Interval = new TimeSpan(0, 0, 0, 0, 250);
            checkServerResponse.Tick    += checkServerResponse_Tick;

            // start loading page data and start listening
            ctrl.loadPageData();
            beginListening();
        }
Пример #3
0
        public CollectionController(GUIPages.GUICollection _parent, Communication _com, Models.CardCollection CardCollection_)
        {
            // attach parent, communication class and card collection
            parent         = _parent;
            com            = _com;
            CardCollection = CardCollection_;

            // the index of the first card that shows on GUI from the filteredCollection
            currentIndex = 0;

            // in the beginning there are no filters set
            filteredCollection = CardCollection_.Cards;

            // list of decks you have
            Decks = new List <Models.CollectionDeck>();

            loadedDataChecklist = new List <bool>()
            {
                false
            };
        }
Пример #4
0
        public GUIGameRoom(GUIWindows.GUI parent_, Communication com_, int GameRoomID_, int DeckID_, Models.CardCollection CardCollection_)
        {
            InitializeComponent();
            parent = parent_;
            ctrl   = new Controllers.GameRoomController(this, com_, GameRoomID_, DeckID_, CardCollection_);

            logger = new Log.Logger();

            grdOwnGrave.Children.Add(new Models.CardGUIModel(null, this, AnimationConstants.graveInitialPosition, Visibility.Hidden).Border);
            grdOppGrave.Children.Add(new Models.CardGUIModel(null, this, AnimationConstants.graveInitialPosition, Visibility.Hidden).Border);

            initButtons();
            initTimers();
            initLists();
            initZoomedInImage();

            ctrl.loadPageData();
            beginListening();
        }
        public GUIGameRoom(GUIWindows.GUI parent, Communication com, int GameRoomID, int DeckID, string OwnNickName, string OppNickName, Models.CardCollection CardCollection)
        {
            InitializeComponent();

            this.parent = parent;
            ownNickName = OwnNickName;
            oppNickName = OppNickName;

            ctrl   = new Controllers.GameRoomController(this, com, GameRoomID, DeckID, CardCollection);
            logger = new Log.Logger();

            grdOwnGrave.Children.Add(new Models.CardGUIModel(null, this, AnimationAndEventsConstants.graveInitialPosition, Visibility.Hidden).Border);
            grdOppGrave.Children.Add(new Models.CardGUIModel(null, this, AnimationAndEventsConstants.graveInitialPosition, Visibility.Hidden).Border);

            initButtons();
            initTimers();
            initLists();
            initZoomedInImage();
            initOtherVariables();

            ctrl.loadPageData();
            beginListening();
        }