예제 #1
0
    public static DealBody read(ByteBuffer data)
    {
        DealBody item = new DealBody();

        item.id        = data.ReadLong();
        item.seller    = data.ReadByte() == 1;
        item.uid       = data.ReadLong();
        item.userName  = data.ReadString();
        item.icon      = data.ReadString();
        item.time      = data.ReadString();
        item.validTime = data.ReadString();
        item.typeStr   = data.ReadByte() == 0 ? "入库" : "现货";
        item.bourse    = data.ReadString();
        item.stampName = data.ReadString();
        item.monad     = data.ReadString();
        item.curNum    = data.ReadInt();
        item.price     = float.Parse(data.ReadString());
        item.context   = data.ReadString();
        item.helpFlag  = data.ReadByte() == 1;
        item.revoke    = data.ReadByte() == 1;
        item.isLock    = data.ReadByte() == 1;
        int revertLen = data.ReadInt();

        for (int j = 0; j < revertLen; j++)
        {
            Revert revert = Revert.read(data);
            item.reverts.Add(revert);
        }
        int orderLen = data.ReadInt();

        for (int j = 0; j < orderLen; j++)
        {
            Order order = Order.read(data);
            order.item = item;
            item.orders.Add(order);
        }
        return(item);
    }