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);
            }
        }
Exemple #2
0
 public void ToBytes(BinaryWriter writer)
 {
     writer.Write((ushort)Type);
     FreshHours.ToBytes(writer);
     TransitionHours.ToBytes(writer);
     TransitionedStack.ToBytes(writer);
     writer.Write(TransitionRatio);
 }
Exemple #3
0
        /// <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);
        }
Exemple #4
0
        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);
            }
        }