/// <summary>
        /// constructor takes server in arguments
        /// </summary>
        /// <param name="Server"></param>
        public VMInnerDecks(Network Server)
        {
            _Server = Server;
            VMDecks decks = new VMDecks(Server);
            decks.moveTo += new EventHandler<MoveToEventArgs>(Inner_moveTo);
            VMBuilding building = new VMBuilding(Server);
            building.moveTo += new EventHandler<MoveToEventArgs>(Inner_moveTo);

            ViewModels = new ObservableCollection<ViewModelBase>()
            {
                decks,
                building
            };
            ViewModelView = CollectionViewSource.GetDefaultView(ViewModels);
        }
Esempio n. 2
0
        void r_GLID(object sender, serverReturnEventArgs e)
        {
            _Server.GLIDReturn -= new EventHandler <serverReturnEventArgs>(r_GLID);
            List <Deck> decks = VMDecks.DeckSpliting(e.data);

            if (decks.Count > 0)
            {
                _Server.SDTUReturn += new EventHandler <serverReturnEventArgs>(r_SDTU);
                _Server.GetDeck(name, decks.Last().Id);
            }
            else
            {
                roomChat.addContent("You need at least one deck to play.");
                surrender(null);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// constructor takes server in arguments
        /// </summary>
        /// <param name="Server"></param>
        public VMInnerDecks(Network Server)
        {
            _Server = Server;
            VMDecks decks = new VMDecks(Server);

            decks.moveTo += new EventHandler <MoveToEventArgs>(Inner_moveTo);
            VMBuilding building = new VMBuilding(Server);

            building.moveTo += new EventHandler <MoveToEventArgs>(Inner_moveTo);

            ViewModels = new ObservableCollection <ViewModelBase>()
            {
                decks,
                building
            };
            ViewModelView = CollectionViewSource.GetDefaultView(ViewModels);
        }