Exemplo n.º 1
0
        public void WriteTo(System.IO.BinaryWriter writer)
        {
            if (writer == null)
                throw new System.ArgumentNullException(nameof(writer));

            writer.Write(PlayerId);
            writer.Write(Id);
            writer.Write(Health);
            Position.WriteTo(writer);
            Size.WriteTo(writer);
            JumpState.WriteTo(writer);
            writer.Write(WalkedRight);
            writer.Write(Stand);
            writer.Write(OnGround);
            writer.Write(OnLadder);
            writer.Write(Mines);

            if (Weapon == null)
                writer.Write(false);
            else
            {
                writer.Write(true);
                Weapon.WriteTo(writer);
            }
        }
Exemplo n.º 2
0
 public void WriteTo(System.IO.BinaryWriter writer)
 {
     writer.Write(PlayerId);
     writer.Write(Id);
     writer.Write(Health);
     Position.WriteTo(writer);
     Size.WriteTo(writer);
     JumpState.WriteTo(writer);
     writer.Write(WalkedRight);
     writer.Write(Stand);
     writer.Write(OnGround);
     writer.Write(OnLadder);
     writer.Write(Mines);
     if (!Weapon.HasValue)
     {
         writer.Write(false);
     }
     else
     {
         writer.Write(true);
         Weapon.Value.WriteTo(writer);
     }
 }