src/Network/Message.hh
author nireco
Thu, 29 Jan 2009 22:23:28 +0200
changeset 442 edde3a342102
parent 434 a8ba81432ddd
permissions -rw-r--r--
couple of images about new worm
#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 */