#ifndef __GNET_SELLPOINTARG_RPCDATA
#define __GNET_SELLPOINTARG_RPCDATA

#include "rpcdefs.h"


namespace GNET
{
	class SellPointArg : public GNET::Rpc::Data
	{
	public:
		int roleid;
		unsigned int localsid;
		int point;
		int price;
		int timestamp;
		int money;

	public:
		SellPointArg (int l_roleid = 0,unsigned int l_localsid = 0,int l_point = 0
			,int l_price = 0,int l_timestamp = 0,int l_money = 0)
			: roleid(l_roleid),localsid(l_localsid),point(l_point)
			,price(l_price),timestamp(l_timestamp),money(l_money)
		{
		}

		SellPointArg(const SellPointArg &rhs)
			: roleid(rhs.roleid),localsid(rhs.localsid),point(rhs.point),
			price(rhs.price),timestamp(rhs.timestamp),money(rhs.money) { }

		Rpc::Data *Clone() const { return new SellPointArg(*this); }

		Rpc::Data& operator = (const Rpc::Data &rhs)
		{
			const SellPointArg *r = dynamic_cast<const SellPointArg *>(&rhs);
			if (r && r != this)
			{
				roleid = r->roleid;
				localsid = r->localsid;
				point = r->point;
				price = r->price;
				timestamp = r->timestamp;
				money = r->money;
			}
			return *this;
		}

		SellPointArg& operator = (const SellPointArg &rhs)
		{
			const SellPointArg *r = &rhs;
			if (r && r != this)
			{
				roleid = r->roleid;
				localsid = r->localsid;
				point = r->point;
				price = r->price;
				timestamp = r->timestamp;
				money = r->money;
			}
			return *this;
		}

		OctetsStream& marshal(OctetsStream & os) const
		{
			os << roleid;
			os << localsid;
			os << point;
			os << price;
			os << timestamp;
			os << money;
			return os;
		}

		const OctetsStream& unmarshal(const OctetsStream &os)
		{
			os >> roleid;
			os >> localsid;
			os >> point;
			os >> price;
			os >> timestamp;
			os >> money;
			return os;
		}

	};
};
#endif
