Esempio n. 1
0
 private void AddPlayHandler(PlayStack playStack)
 {
     playStack.MouseDown += (sender, e) =>
     {
         SetupMove(playStack.Stack);
     };
     playStack.MouseUp += (sender, e) =>
     {
         SetupMove(playStack.Stack);
     };
     playStack.MouseDoubleClick += (sender, e) =>
     {
         var top = playStack.Stack.Top;
         if (top != null)
         {
             var dest = Field.FinishStacks.FirstOrDefault(s => s.CanAccept(playStack.Stack.Top));
             if (dest != null)
             {
                 top.Move(dest);
             }
         }
     };
 }
Esempio n. 2
0
 private void AddPlayHandler(PlayStack playStack)
 {
     playStack.MouseDown += (sender, e) =>
     {
         SetupMove(playStack.Stack);
     };
     playStack.MouseUp += (sender, e) =>
     {
         SetupMove(playStack.Stack);
     };
     playStack.MouseDoubleClick += (sender, e) =>
         {
             var top = playStack.Stack.Top;
             if (top != null)
             {
                 var dest = Field.FinishStacks.FirstOrDefault(s => s.CanAccept(playStack.Stack.Top));
                 if (dest != null)
                     top.Move(dest);
             }
         };
 }