Exemplo n.º 1
0
 private static void NewPlayer(object sender, NewPersonEventArgs e)
 {
     if (_p1 == null)
     {
         _p1 = e.Person;
         Console.WriteLine("Player1 detected");
         sgcP1             = new SteeringGestureChecker(e.Person);
         tgcP1             = new ThrustGestureChecker(e.Person);
         fgcP1             = new FootGestureChecker(e.Person);
         sgcP1.Successful += P1Steered;
         tgcP1.Successful += P1Thrusted;
         fgcP1.Successful += P1PowerUp;
     }
     else if (_p2 == null)
     {
         _p2 = e.Person;
         Console.WriteLine("Player2 detected");
         sgcP2             = new SteeringGestureChecker(e.Person);
         tgcP2             = new ThrustGestureChecker(e.Person);
         fgcP2             = new FootGestureChecker(e.Person);
         sgcP2.Successful += P2Steered;
         tgcP2.Successful += P2Thrusted;
         fgcP2.Successful += P2PowerUp;
     }
     else
     {
         Console.WriteLine("Sorry, game is full");
     }
 }
Exemplo n.º 2
0
 private void NewPerson(object src, NewPersonEventArgs e)
 {
     if (_active == null)
     {
         LoginText.Visibility = Visibility.Visible;
     }
     UpdatePersonsCount();
     e.Person.OnWave += waved;
 }
Exemplo n.º 3
0
 static void NewPerson(object src, NewPersonEventArgs newPersonEventArgs)
 {
     jgc             = new JumpGestureChecker(newPersonEventArgs.Person); // Anlegen des Eigenen GestureCheckers
     jgc.Successful += delegate { Console.WriteLine("Jump"); };           // Registrieren auf dessen Event
 }