public virtual bool Load(MemoryStream _buf_) { try { if (sizeof(ulong) > _buf_.Length - _buf_.Position) { return(false); } unit_seq = BitConverter.ToUInt64(_buf_.GetBuffer(), (int)_buf_.Position); _buf_.Position += sizeof(ulong); if (false == Vector2Int_Serializer.Load(ref position, _buf_)) { return(false); } if (sizeof(int) > _buf_.Length - _buf_.Position) { return(false); } int equip_items_length = BitConverter.ToInt32(_buf_.GetBuffer(), (int)_buf_.Position); _buf_.Position += sizeof(int); for (int equip_items_itr = 0; equip_items_itr < equip_items_length; equip_items_itr++) { uint equip_items_val = 0; if (sizeof(uint) > _buf_.Length - _buf_.Position) { return(false); } equip_items_val = BitConverter.ToUInt32(_buf_.GetBuffer(), (int)_buf_.Position); _buf_.Position += sizeof(uint); equip_items.Add(equip_items_val); } } catch (System.Exception) { return(false); } return(true); }
public virtual bool Load(MemoryStream _buf_) { try { if (sizeof(ulong) > _buf_.Length - _buf_.Position) { return(false); } seq = BitConverter.ToUInt64(_buf_.GetBuffer(), (int)_buf_.Position); _buf_.Position += sizeof(ulong); if (false == Vector2Int_Serializer.Load(ref position, _buf_)) { return(false); } } catch (System.Exception) { return(false); } return(true); }