public void Teleport(OrganismState state)
{
if (null == state)
{
throw new Exception("Null object passed into Teleport");
}
TeleportState teleportState = new TeleportState();
Organism organism = Scheduler.GetOrganism(state.ID);
state.MakeImmutable();
teleportState.OrganismState = state;
teleportState.Organism = organism;
teleportState.OrganismWrapper = new OrganismWrapper(organism);
teleportState.Originator = _newWorldState.StateGuid;
teleportState.Country = GameConfig.UserCountry;
teleportState.State = GameConfig.UserState;
// Remove it from this world
removeOrganism(new KilledOrganism(state.ID, PopulationChangeReason.TeleportedFrom));
// Teleport the organism through the network engine
if (_usingNetwork)
{
_networkEngine.Teleport(teleportState);
}
else
{
ReceiveTeleportation(teleportState, true);
}
}