예제 #1
0
 void r_MOVE(object sender, serverReturnEventArgs e)
 {
     if (e.data.Contains("destination"))
     {
         if (VMProfile.getval(e.data, "destination").Equals("Battlefield"))
         {
             string gameId = VMProfile.getval(e.data, "idCard");
             if (OppBoard.Where(c => c.gameId == gameId).Count() == 0)
             {
                 var url = VMProfile.getval(e.data, "url");
                 var x   = int.Parse(VMProfile.getval(e.data, "X"));
                 var y   = int.Parse(VMProfile.getval(e.data, "Y"));
                 Application.Current.Dispatcher.Invoke(new Action(delegate()
                 {
                     OppBoard.Add(new SimpleCard(url, Location.Battlefield, gameId, x, y));
                 }), null);
             }
         }
     }
 }
예제 #2
0
        void r_RSET(object sender, serverReturnEventArgs e)
        {
            Application.Current.Dispatcher.Invoke(new Action(delegate()
            {
                Deck.Clear();
                Hand.Clear();
                MyBoard.Clear();
                OppBoard.Clear();
                Exile.Clear();
                Grave.Clear();
                MYPV  = 20;
                HISPV = 20;
            }), null);
            MoveToEventArgs args = new MoveToEventArgs("Room");
            EventHandler <MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
            {
                handler(this, args);
            }
        }