public uint GetSize() { uint size = 0; size += sizeof(ushort); for (int i = 0; i < items.Count; ++i) { DB_Item item = items[i]; size += item.GetSize(); } return(size); }
public DB_Item(DB_Item rho) { itemID = rho.itemID; itemName = rho.itemName; itemDesc = rho.itemDesc; iconName = rho.iconName; price = rho.price; option = rho.option; itemType = rho.itemType; itemKindType = rho.itemKindType; isConsume = rho.isConsume; scopeType = rho.scopeType; occasionType = rho.occasionType; }
public bool Encode(BinaryEncoder encoder) { { ushort _size = (ushort)items.Count; if (!BinaryCodec.Encode(encoder, _size)) { return(false); } for (int i = 0; i < items.Count; ++i) { DB_Item item = items[i]; if (!item.Encode(encoder)) { return(false); } } } return(true); }
public bool Decode(BinaryDecoder decoder) { { ushort _size = 0; if (!BinaryCodec.Decode(decoder, out _size)) { return(false); } items.Capacity = _size; for (int i = 0; i < _size; ++i) { DB_Item item = new DB_Item(); if (!item.Decode(decoder)) { return(false); } items.Add(item); } } return(true); }