#pragma once #include "Entities.hpp" #include #include #include /* forward declaration(s) */ struct Player; struct Group { std::vector members; std::vector filter(EntityKind kind) { std::vector filtered; std::copy_if(members.begin(), members.end(), std::back_inserter(filtered), [kind](EntityRef e) { return e.kind == kind; }); return filtered; } Group(EntityRef leader); }; namespace Groups { void init(); void sendToGroup(Group* group, void* buf, uint32_t type, size_t size); void sendToGroup(Group* group, EntityRef excluded, void* buf, uint32_t type, size_t size); void groupTickInfo(CNSocket* sock); void groupKick(Group* group, EntityRef ref); void addToGroup(Group* group, EntityRef member); bool removeFromGroup(Group* group, EntityRef member); // true iff group deleted void disbandGroup(Group* group); }