Ejemplo n.º 1
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            var version = writer.SetVersion(2);

            switch (version)
            {
            case 2:
                writer.WriteTextDef(_CashAbbr);
                goto case 1;

            case 1:
                CashProperty.Serialize(writer);
                goto case 0;

            case 0:
            {
                CashType.Serialize(writer);

                writer.WriteTextDef(_CashName);
                writer.Write(_ShowCashName);

                writer.Write(_Trading);

                writer.Write(Discount);
                writer.Write(DiscountEnabled);
                writer.Write(DiscountYell);
            }
            break;
            }
        }
Ejemplo n.º 2
0
        public override void Serialize(GenericWriter writer)
        {
            _DynamicStock.RemoveRange(o => o.Key.Deleted || o.Value == null || o.Value.Item != o.Key);

            base.Serialize(writer);

            var version = writer.SetVersion(4);

            switch (version)
            {
            case 4:
            {
                writer.WriteDictionary(_DynamicStock, (w, item, info) => info.Serialize(w));
            }
                goto case 3;

            case 3:
            {
                writer.Write(_WasStocked);
                writer.Write(CanRestock);
            }
                goto case 2;

            case 2:
                writer.WriteTextDef(_CashAbbr);
                goto case 1;

            case 1:
                CashProperty.Serialize(writer);
                goto case 0;

            case 0:
            {
                CashType.Serialize(writer);

                writer.WriteTextDef(_CashName);
                writer.Write(_ShowCashName);

                writer.Write(_Trading);

                writer.Write(Discount);
                writer.Write(DiscountEnabled);
                writer.Write(DiscountYell);
            }
            break;
            }
        }