#pragma once #include #include #include struct Empty{}; BOOST_FUSION_DEFINE_STRUCT( , Size, (int, width) (int, height) ) BOOST_FUSION_DEFINE_STRUCT( , Position, (int, x) (int, y) ) BOOST_FUSION_DEFINE_STRUCT( , IncomingPacket, (std::string, name) (Size, size) ) struct User { unsigned int index{0}; std::string name{"Unknown guest"}; bool update_lines{true}; Size size{0,0}; Position position{0,0}; template bool is_inside(Ball b){ float x = b.position.x; float y = b.position.y; return position.x < x && x < position.x + size.width && position.y < y && y < position.y + size.height; } User& operator=(IncomingPacket const & p){ name = p.name; size = p.size; return *this; } }; BOOST_FUSION_ADAPT_STRUCT( User, (unsigned int, index) (std::string, name) (Size, size) (Position, position) )