示例#1
0
        public override NetmsgAgreement Clone()
        {
            NetmsgAgreementArrayDouble p = new NetmsgAgreementArrayDouble();

            p.IsBIgArray = m_bBigArray;
            return(p);
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="etype"></param>
        /// <param name="type">0 is single value,1 is small array[255] ,2 is big array</param>
        /// <returns></returns>
        public static NetmsgAgreement Create(EnumNetAgreement etype, bool bArray, bool bBigArray)
        {
            switch (etype)
            {
            case EnumNetAgreement.ENA_VALUETYPE_STRING:
                return(new NetmsgAgreementString());

            case EnumNetAgreement.ENA_VALUETYPE_INT8:
                if (bArray)
                {
                    NetmsgAgreemenArrayUint8 a = new NetmsgAgreemenArrayUint8();
                    a.IsBIgArray = bBigArray;
                    return(a);
                }
                else
                {
                    return(new NetmsgAgreementValueUint8());
                }

            case EnumNetAgreement.ENA_VALUETYPE_INT16:
                if (bArray)
                {
                    NetmsgAgreementArrayUint16 a = new NetmsgAgreementArrayUint16();
                    a.IsBIgArray = bBigArray;
                    return(a);
                }
                else
                {
                    return(new NetmsgAgreementValueUint16());
                }

            case EnumNetAgreement.ENA_VALUETYPE_INT32:
                if (bArray)
                {
                    NetmsgAgreementArrayUint32 a = new NetmsgAgreementArrayUint32();
                    a.IsBIgArray = bBigArray;
                    return(a);
                }
                else
                {
                    return(new NetmsgAgreementValueUint32());
                }

            case EnumNetAgreement.ENA_VALUETYPE_INT64:
                if (bArray)
                {
                    NetmsgAgreementArrayUint64 a = new NetmsgAgreementArrayUint64();
                    a.IsBIgArray = bBigArray;
                    return(a);
                }
                else
                {
                    return(new NetmsgAgreementValueUint64());
                }

            case EnumNetAgreement.ENA_VALUETYPE_FLOAT:
                if (bArray)
                {
                    NetmsgAgreementArrayFloat a = new NetmsgAgreementArrayFloat();
                    a.IsBIgArray = bBigArray;
                    return(a);
                }
                else
                {
                    return(new NetmsgAgreementValueFloat());
                }

            case EnumNetAgreement.ENA_VALUETYPE_DOUBLE:
                if (bArray)
                {
                    NetmsgAgreementArrayDouble a = new NetmsgAgreementArrayDouble();
                    a.IsBIgArray = bBigArray;
                    return(a);
                }
                else
                {
                    return(new NetmsgAgreementValueDouble());
                }
            }
            return(null);
        }