Пример #1
0
 private void ShotFired(Player voPlayer)
 {
     //System.Media.SystemSounds.Beep.Play();
     // trigger – hier kann dass script getriggert werden.
     if (FireEvent != null)
         FireEvent();
 }
Пример #2
0
 private void PlayerEntered(Player voPlayer)
 {
     voPlayer.PlayerRenamed += this.PlayerRenamed;
     voPlayer.ShotFired += this.ShotFired;
 }
Пример #3
0
 private void PlayerRenamed(Player voPlayer)
 {
     // sollte eine freund/feind unterscheidung notwendig werden, kann das hier abgefragt werden
 }
Пример #4
0
 private void PlayerShot(Player p)
 {
     //if (!p.IsFriend)
     //	Console.WriteLine("Player " + p.Name + "(" + p.ID + ") fired a shot");
     //else
         p.Shot.ShotCeased += ShotCease;
 }
Пример #5
0
 private double GetDiffToEntity(Player me, Entity e)
 {
     double dRet = EMin?double.MaxValue:double.MinValue;
     switch (EntityOrder) {
     case EOrder.DISTANCE: dRet = me.Position.VirtualDistanceTo(e.Position); break;
     case EOrder.ANGLE: Console.WriteLine("IMPLEMENT ANGLE DIFF"); break;
     case EOrder.TIME: Console.WriteLine("IMPLEMENT TIME DIFF"); break;
     }
     return dRet;
 }
Пример #6
0
 private void PlayerRenamed(Player p)
 {
     Console.WriteLine("Player " + p.ID + " renamed to " + p.Name);
 }
Пример #7
0
 private void PlayerLeft(Player p)
 {
     Console.WriteLine("Player " + p.Name + "(" + p.ID + ") left the game");
 }
Пример #8
0
 private void PlayerEntered(Player p)
 {
     Console.WriteLine("Player " + p.Name + "(" + p.ID + ") entered the game");
     p.PlayerLeft += PlayerLeft;
     p.ShotFired += PlayerShot;
     p.PlayerRenamed += PlayerRenamed;
 }
Пример #9
0
 public Player GetPlayer(long id)
 {
     Player oRet = null;
     if (mcoPlayers.ContainsKey(id)) {
         oRet = mcoPlayers[id];
     } else {
         oRet = new Player(this, id);
         mcoPlayers.Add(id, oRet);
         PlayerEntered(oRet);
     }
     return oRet;
 }
Пример #10
0
 private void PlayerEntered(Player p)
 {
     if (FireEvent != null)
         FireEvent();
 }