You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
702 B
48 lines
702 B
11 years ago
|
#pragma once
|
||
|
|
||
|
#include <string>
|
||
|
#include <boost/fusion/include/define_struct.hpp>
|
||
|
#include <boost/fusion/include/adapt_struct.hpp>
|
||
|
|
||
|
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"};
|
||
|
|
||
|
Size size{0,0};
|
||
|
Position position{0,0};
|
||
|
|
||
|
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)
|
||
|
)
|