sanguis::server::entities::remove_from_world_result sanguis::server::entities::with_ghosts::remove_from_world() { sanguis::server::environment::object &cur_environment( FCPPT_ASSERT_OPTIONAL_ERROR( this->environment() ).get() ); return sanguis::server::entities::remove_from_world_result( fcppt::algorithm::map_concat< sanguis::collision::world::body_exit_container >( ghosts_, [ this, &cur_environment ]( sanguis::server::collision::ghost &_ghost ) { return _ghost.destroy( cur_environment.collision_world() ); } ) ); }
void sanguis::server::entities::enemies::enemy::remove_from_game() { fcppt::optional::maybe_void( spawn_owner_.get().get(), [ this ]( fcppt::reference< sanguis::server::entities::with_links > const _spawn_owner ) { fcppt::cast::static_downcast< sanguis::server::entities::spawns::spawn & >( _spawn_owner.get() ) .unregister( *this ); } ); sanguis::server::environment::object &cur_environment( FCPPT_ASSERT_OPTIONAL_ERROR( this->environment() ).get() ); sanguis::server::environment::insert_no_result( cur_environment, fcppt::unique_ptr_to_base< sanguis::server::entities::simple >( fcppt::make_unique_ptr< sanguis::server::entities::exp_area >( exp_ ) ), sanguis::server::entities::insert_parameters_center( this->center() ) ); cur_environment.pickup_chance( pickup_probability_, difficulty_, this->center() ); }