Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
 public virtual void WriteToStream(Stream stream)
 {
     PlayerInventory.Serialize(stream, this);
 }
Esempio n. 4
0
 public byte[] ToProtoBytes()
 {
     return(PlayerInventory.SerializeToBytes(this));
 }
Esempio n. 5
0
 public void ToProto(Stream stream)
 {
     PlayerInventory.Serialize(stream, this);
 }
Esempio n. 6
0
 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);
 }
Esempio n. 7
0
 public void ResetToPool()
 {
     PlayerInventory.ResetToPool(this);
 }
Esempio n. 8
0
 public virtual void ReadFromStream(Stream stream, int size, bool isDelta = false)
 {
     PlayerInventory.DeserializeLength(stream, size, this, isDelta);
 }
Esempio n. 9
0
 public void FromProto(Stream stream, bool isDelta = false)
 {
     PlayerInventory.Deserialize(stream, this, isDelta);
 }