mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 13:30:06 +00:00
d32827b692
Was getting frustrated by the inconsistency in our include statements, which were causing me problems. As a result, I went through and manually re-organized every include statement in non-core files. I'm just gonna copy my rant from Discord: FOR HEADER FILES (.hpp): - everything you use IN THE HEADER must be EXPLICITLY INCLUDED with the exception of things that fall under Core.hpp - you may NOT include ANYTHING ELSE FOR SOURCE FILES (.cpp): - you can #include whatever you want as long as the partner header is included first - anything that gets included by another include is fair game - redundant includes are ok because they'll be harmless AS LONG AS our header files stay lean. the point of this is NOT to optimize the number of includes used all around or make things more efficient necessarily. it's to improve readability & coherence and make it easier to avoid cyclical issues
35 lines
804 B
C++
35 lines
804 B
C++
#pragma once
|
|
|
|
#include "Entities.hpp"
|
|
|
|
#include <vector>
|
|
#include <map>
|
|
#include <list>
|
|
|
|
/* forward declaration(s) */
|
|
struct Player;
|
|
|
|
struct Group {
|
|
std::vector<EntityRef> members;
|
|
|
|
std::vector<EntityRef> filter(EntityKind kind) {
|
|
std::vector<EntityRef> filtered;
|
|
std::copy_if(members.begin(), members.end(), std::back_inserter(filtered), [kind](EntityRef e) {
|
|
return e.kind == kind;
|
|
});
|
|
return filtered;
|
|
}
|
|
};
|
|
|
|
namespace Groups {
|
|
void init();
|
|
|
|
void sendToGroup(Group* group, void* buf, uint32_t type, size_t size);
|
|
void groupTickInfo(Player* plr);
|
|
void groupKick(Player* plr);
|
|
|
|
void addToGroup(EntityRef member, Group* group);
|
|
void removeFromGroup(EntityRef member, Group* group);
|
|
void disbandGroup(Group* group);
|
|
}
|