public bool MoveShip(Spaceship ship, ArbiterTreeNode transferNode) { string token = ship.Token; ArbiterTreeNode sourceNode; if (!_nodeByShipToken.Remove(token, out sourceNode)) { return(false); } _nodeByShipToken[token] = transferNode; sourceNode.ShipCount--; transferNode.ShipCount++; Messages.ShipTransferred msg = new Messages.ShipTransferred() { Ship = ship }; BusMaster.SendMessage(msg, transferNode.Peer); return(true); }
private void OnShipTransferred(NetPeer peer, Messages.ShipTransferred msg) { LocalSpaceship localShip = new LocalSpaceship(msg.Ship, _gameTime); QuadTreeNode.ShipsByToken.Add(msg.Ship.Token, localShip); }