private void ShotFired(Player voPlayer) { //System.Media.SystemSounds.Beep.Play(); // trigger – hier kann dass script getriggert werden. if (FireEvent != null) FireEvent(); }
private void PlayerEntered(Player voPlayer) { voPlayer.PlayerRenamed += this.PlayerRenamed; voPlayer.ShotFired += this.ShotFired; }
private void PlayerRenamed(Player voPlayer) { // sollte eine freund/feind unterscheidung notwendig werden, kann das hier abgefragt werden }
private void PlayerShot(Player p) { //if (!p.IsFriend) // Console.WriteLine("Player " + p.Name + "(" + p.ID + ") fired a shot"); //else p.Shot.ShotCeased += ShotCease; }
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; }
private void PlayerRenamed(Player p) { Console.WriteLine("Player " + p.ID + " renamed to " + p.Name); }
private void PlayerLeft(Player p) { Console.WriteLine("Player " + p.Name + "(" + p.ID + ") left the game"); }
private void PlayerEntered(Player p) { Console.WriteLine("Player " + p.Name + "(" + p.ID + ") entered the game"); p.PlayerLeft += PlayerLeft; p.ShotFired += PlayerShot; p.PlayerRenamed += PlayerRenamed; }
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; }
private void PlayerEntered(Player p) { if (FireEvent != null) FireEvent(); }