public virtual void ToBytes(BinaryWriter writer) { writer.Write(IsWildCard); writer.Write((int)Type); writer.Write(Code.ToShortString()); writer.Write(Quantity); if (!IsWildCard) { ResolvedItemstack.ToBytes(writer); } writer.Write(IsTool); writer.Write(ToolDurabilityCost); writer.Write(AllowedVariants != null); if (AllowedVariants != null) { writer.Write(AllowedVariants.Length); for (int i = 0; i < AllowedVariants.Length; i++) { writer.Write(AllowedVariants[i]); } } writer.Write(ReturnedStack?.ResolvedItemstack != null); if (ReturnedStack?.ResolvedItemstack != null) { ReturnedStack.ToBytes(writer); } }
public void ToBytes(BinaryWriter writer) { writer.Write((ushort)Type); FreshHours.ToBytes(writer); TransitionHours.ToBytes(writer); TransitionedStack.ToBytes(writer); writer.Write(TransitionRatio); }
/// <summary> /// Serialized the alloy /// </summary> /// <param name="writer"></param> public void ToBytes(BinaryWriter writer) { writer.Write(Ingredients.Length); for (int i = 0; i < Ingredients.Length; i++) { Ingredients[i].ToBytes(writer); } Output.ToBytes(writer); }
public override void ToBytes(BinaryWriter writer) { base.ToBytes(writer); writer.Write(ShapeElement == null); if (ShapeElement != null) { writer.Write(ShapeElement); } writer.Write(TextureMapping == null); if (TextureMapping != null) { writer.Write(TextureMapping[0]); writer.Write(TextureMapping[1]); } writer.Write(CookedStack == null); if (CookedStack != null) { CookedStack.ToBytes(writer); } }