private void OnEntityEntered(object sender, EntityMovedEventArgs e) { // God this is so hacky but I don't want to fix things right now. // TODO: Fix this. // Seriously, please fix this. // Please. Dictionary<string, string> reverseDirection = new Dictionary<string,string>(); reverseDirection.Add("north", "south"); reverseDirection.Add("south", "north"); reverseDirection.Add("east", "west"); reverseDirection.Add("west", "east"); string message = String.Format("{0} entered the area", e.Entity.GetFullName().FirstCharToUpper()); if (e.Path != null && e.Path.From != null) message += String.Format(" from the [{0}]", reverseDirection[e.Path.Identifier]); message += "."; if (e.Entity is Player) { Broadcast(message, (Player)e.Entity); } else { Broadcast(message); } }
private void OnEntityLeft(object sender, EntityMovedEventArgs e) { string message = String.Format("{0} left the area.", e.Entity.GetFullName().FirstCharToUpper()); if (e.Path != null && e.Path.To != null) message = String.Format("{0} moved [{1}].", e.Entity.Name.FirstCharToUpper(), e.Path.Identifier); if (e.Entity is Player) { Broadcast(message, (Player)e.Entity); } else { Broadcast(message); } }