src/Network/Message.hh
author Tero Marttila <terom@fixme.fi>
Sun, 02 Jun 2013 16:15:23 +0300
changeset 448 34bdf0783874
parent 434 a8ba81432ddd
permissions -rw-r--r--
network: fix size_t compile errors
#ifndef NETWORK_MESSAGE_HH
#define NETWORK_MESSAGE_HH

/**
 * @file
 *
 * NetworkPacket for use with NetworkObjects
 */

#include "Channel.hh"
#include "Object.hh"

/**
 * NetworkMessages are NetworkPackets that are related to some specfic NetworkObject and its NetworkObjectController.
 */
class NetworkMessage : public NetworkChannelPacket {
    public:
        /**
         * Create a message of the given type to be sent on the given object
         */
        NetworkMessage (NetworkObject &obj, NetworkMessageID msg_id);

        /**
         * Write the given Object's NetworkObjectID (or 0, if the obj is NULL) to this p acket
         *
         * @param obj the NetworkObject* whose NetworkObjectID to write to the packet, or NULL to write zero
         */
        void write_object (const NetworkObject *obj);
};

#endif /* NETWORK_MESSAGE_HH */