public ProtoBuf.PlayerInventory Save(bool bForDisk) { ProtoBuf.PlayerInventory playerInventory = Facepunch.Pool.Get <ProtoBuf.PlayerInventory>(); if (bForDisk) { playerInventory.invMain = this.containerMain.Save(); } playerInventory.invBelt = this.containerBelt.Save(); playerInventory.invWear = this.containerWear.Save(); return(playerInventory); }
public void Load(ProtoBuf.PlayerInventory msg) { if (msg.invMain != null) { this.containerMain.Load(msg.invMain); } if (msg.invBelt != null) { this.containerBelt.Load(msg.invBelt); } if (msg.invWear != null) { this.containerWear.Load(msg.invWear); } }
public virtual void WriteToStream(Stream stream) { PlayerInventory.Serialize(stream, this); }
public byte[] ToProtoBytes() { return(PlayerInventory.SerializeToBytes(this)); }
public void ToProto(Stream stream) { PlayerInventory.Serialize(stream, this); }
public static void SerializeLengthDelimited(Stream stream, PlayerInventory instance) { byte[] bytes = PlayerInventory.SerializeToBytes(instance); ProtocolParser.WriteUInt32(stream, (uint)bytes.Length); stream.Write(bytes, 0, (int)bytes.Length); }
public void ResetToPool() { PlayerInventory.ResetToPool(this); }
public virtual void ReadFromStream(Stream stream, int size, bool isDelta = false) { PlayerInventory.DeserializeLength(stream, size, this, isDelta); }
public void FromProto(Stream stream, bool isDelta = false) { PlayerInventory.Deserialize(stream, this, isDelta); }