Add current progression
This commit is contained in:
@@ -28,6 +28,7 @@ enum class GameMessageType
|
||||
TEST,
|
||||
SETNAME,
|
||||
PHYSICSTATEMESSAGE,
|
||||
INPUTSTATEMESSAGE,
|
||||
COUNT
|
||||
};
|
||||
|
||||
@@ -86,11 +87,31 @@ public:
|
||||
YOJIMBO_VIRTUAL_SERIALIZE_FUNCTIONS();
|
||||
};
|
||||
|
||||
class InputStateMessage : public yojimbo::Message
|
||||
{
|
||||
public:
|
||||
float m_vel_x, m_vel_y;
|
||||
|
||||
InputStateMessage() : m_vel_x(0), m_vel_y(0) {}
|
||||
|
||||
template <typename Stream>
|
||||
bool Serialize(Stream &stream)
|
||||
{
|
||||
serialize_float(stream, m_vel_x);
|
||||
serialize_float(stream, m_vel_y);
|
||||
return true;
|
||||
}
|
||||
|
||||
YOJIMBO_VIRTUAL_SERIALIZE_FUNCTIONS();
|
||||
};
|
||||
|
||||
|
||||
// the message factory
|
||||
YOJIMBO_MESSAGE_FACTORY_START(GameMessageFactory, (int)GameMessageType::COUNT);
|
||||
YOJIMBO_DECLARE_MESSAGE_TYPE((int)GameMessageType::TEST, TestMessage);
|
||||
YOJIMBO_DECLARE_MESSAGE_TYPE((int)GameMessageType::SETNAME, SetNameMessage);
|
||||
YOJIMBO_DECLARE_MESSAGE_TYPE((int)GameMessageType::PHYSICSTATEMESSAGE, PhysicStateMessage);
|
||||
YOJIMBO_DECLARE_MESSAGE_TYPE((int)GameMessageType::INPUTSTATEMESSAGE, InputStateMessage);
|
||||
YOJIMBO_MESSAGE_FACTORY_FINISH();
|
||||
|
||||
// the adapter
|
||||
|
||||
Reference in New Issue
Block a user