public virtual void MoveShipHere(NPCShip npc) { if (npc.GetArea() != null) { npc.GetArea().RemoveShip(npc); } AddShip(npc); }
public override void MoveShipHere(NPCShip npc) { if (npc.GetArea() != null) { npc.GetArea().RemoveShip(npc); } addShip(npc); }
public override void MoveShipHere(NPCShip npc) { if (npc.CurrentAreaId != null) { npc.GetArea().RemoveShip(npc); } AddShip(npc); }
public virtual void RemoveShip(NPCShip npc) { ISimulatable temp; _model.ShipIDs.Remove(npc.Id); _shipCache.Remove(npc.Id); SimulatableObjects.TryRemove(npc.Id, out temp); MessageRemoveKillRevive msgData = new MessageRemoveKillRevive { ActionType = ActionType.Remove, ObjectType = RemovableObjectTypes.Ship }; msgData.ObjectIDs.Add(npc.Id); BroadcastMessage(new NetworkMessageContainer(msgData, MessageTypes.RemoveKillRevive)); }
public virtual void AddShip(NPCShip npc, bool suspendNetworking = false) { _model.ShipIDs.Add(npc.Id); lock (SHIPLOCK) { if (!_shipCache.ContainsKey(npc.Id)) { _shipCache.Add(npc.Id, npc);//Somehow, this sometimes throws an exception. Ergo lock. } } SimulatableObjects.TryAdd(npc.Id, npc); if (!suspendNetworking) { var messageData = new MessageReceiveNewShips(); messageData.Ships.Add(npc.GetNetworkData(true, true, false, true)); BroadcastMessage(new NetworkMessageContainer(messageData, MessageTypes.ReceiveNewShips), npc.PlayerID); } }
public override void RemoveShip(NPCShip npc) { _model.ShipIDs.Remove(npc.Id); _shipCache.Remove(npc.Id); }
public override void AddShip(NPCShip npc, bool suspendNetworking) { _model.ShipIDs.Add(npc.Id); _shipCache.Add(npc.Id, npc); }