public bool Add(ISimpleGameObject obj) { if (!AddToPrimaryRegionAndTiles(obj)) { return(false); } // Keeps track of objects that exist in the map obj.InWorld = true; RegisterObjectEventListeners(obj); // Add appropriate objects to the minimap IMiniMapRegionObject miniMapRegionObject = obj as IMiniMapRegionObject; if (miniMapRegionObject != null) { MiniMapRegions.Add(miniMapRegionObject); } // Post to channel ushort regionId = regionLocator.GetRegionIndex(obj); channel.Post("/WORLD/" + regionId, () => { var packet = new Packet(Command.ObjectAdd); packet.AddUInt16(regionId); PacketHelper.AddToPacket(obj, packet); return(packet); }); // Raise event ObjectAdded.Raise(this, new ObjectEvent(obj)); return(true); }