2 // SPDX-License-Identifier: LGPL-2.1-or-later
3 // Copyright (C) 2010-2018 nerzhul, Loic BLOT <loic.blot@unix-experience.fr>
9 #include "../activeobjectmgr.h"
10 #include "serveractiveobject.h"
14 class ActiveObjectMgr final
: public ::ActiveObjectMgr
<ServerActiveObject
>
17 ~ActiveObjectMgr() override
;
19 // If cb returns true, the obj will be deleted
20 void clearIf(const std::function
<bool(ServerActiveObject
*, u16
)> &cb
);
21 void step(float dtime
,
22 const std::function
<void(ServerActiveObject
*)> &f
) override
;
23 bool registerObject(std::unique_ptr
<ServerActiveObject
> obj
) override
;
24 void removeObject(u16 id
) override
;
26 void invalidateActiveObjectObserverCaches();
28 void getObjectsInsideRadius(const v3f
&pos
, float radius
,
29 std::vector
<ServerActiveObject
*> &result
,
30 std::function
<bool(ServerActiveObject
*obj
)> include_obj_cb
);
31 void getObjectsInArea(const aabb3f
&box
,
32 std::vector
<ServerActiveObject
*> &result
,
33 std::function
<bool(ServerActiveObject
*obj
)> include_obj_cb
);
34 void getAddedActiveObjectsAroundPos(
35 const v3f
&player_pos
, const std::string
&player_name
,
36 f32 radius
, f32 player_radius
,
37 const std::set
<u16
> ¤t_objects
,
38 std::vector
<u16
> &added_objects
);