public void AddObjectToMap(ClonedObjectBase obj) { if (_coList.ContainsKey(obj.GetTFID())) _coList[obj.GetTFID()] = obj; else _coList.Add(obj.GetTFID(), obj); }
public void BroadcastChat(ChatType type, Packet packet, ClonedObjectBase source) { foreach (var pair in _coList) { if (!(pair.Value is Character)) continue; var dX = pair.Value.Position.X - source.Position.X; var dY = pair.Value.Position.X - source.Position.Y; var dist = Math.Sqrt(dX * dX + dY * dY); switch (type) { default: Logger.WriteLog("Unhandled ChatType in BroadcastChat: {0}", LogType.Error, type); break; } (pair.Value as Character).Connection.SendPacket(packet, RPCGuaranteeType.RPCGuaranteedOrdered); } }
public Inventory(Int32 x, Int32 y, Int32 numPages) { _map = null; _gridSpace = null; _inventoryType = InventoryType.None; _owner = null; _doubleCheckBlock = false; _dirty = false; _x = x; _y = y; _numPages = numPages; if (_x <= 0) _x = 1; if (_y <= 0) _y = 1; if (_numPages <= 0) _numPages = 1; CreateGridSpace(); }
public void SetParent(ClonedObjectBase parent) { WaitingForParent = false; Parent = parent; }
public void SetOwner(ClonedObjectBase owner) { _owner = owner; // TODO: foreach item in inevntory: setowner(owner) }