public static LuckyDrawSetUnityView Deserialize(Stream bytes)
        {
            var mask = Int32Proxy.Deserialize(bytes);
            var view = new LuckyDrawSetUnityView();

            view.CreditsAttributed    = Int32Proxy.Deserialize(bytes);
            view.ExposeItemsToPlayers = BooleanProxy.Deserialize(bytes);
            view.Id = Int32Proxy.Deserialize(bytes);

            if ((mask & 1) != 0)
            {
                view.ImageUrl = StringProxy.Deserialize(bytes);
            }

            view.LuckyDrawId = Int32Proxy.Deserialize(bytes);

            if ((mask & 2) != 0)
            {
                view.LuckyDrawSetItems = ListProxy <BundleItemView> .Deserialize(bytes, BundleItemViewProxy.Deserialize);
            }

            view.PointsAttributed = Int32Proxy.Deserialize(bytes);
            view.SetWeight        = Int32Proxy.Deserialize(bytes);
            return(view);
        }
Beispiel #2
0
        // Token: 0x06001057 RID: 4183 RVA: 0x00013BC0 File Offset: 0x00011DC0
        public static void Serialize(Stream stream, LuckyDrawSetUnityView instance)
        {
            int num = 0;

            using (MemoryStream memoryStream = new MemoryStream())
            {
                Int32Proxy.Serialize(memoryStream, instance.CreditsAttributed);
                BooleanProxy.Serialize(memoryStream, instance.ExposeItemsToPlayers);
                Int32Proxy.Serialize(memoryStream, instance.Id);
                if (instance.ImageUrl != null)
                {
                    StringProxy.Serialize(memoryStream, instance.ImageUrl);
                }
                else
                {
                    num |= 1;
                }
                Int32Proxy.Serialize(memoryStream, instance.LuckyDrawId);
                if (instance.LuckyDrawSetItems != null)
                {
                    ListProxy <BundleItemView> .Serialize(memoryStream, instance.LuckyDrawSetItems, new ListProxy <BundleItemView> .Serializer <BundleItemView>(BundleItemViewProxy.Serialize));
                }
                else
                {
                    num |= 2;
                }
                Int32Proxy.Serialize(memoryStream, instance.PointsAttributed);
                Int32Proxy.Serialize(memoryStream, instance.SetWeight);
                Int32Proxy.Serialize(stream, ~num);
                memoryStream.WriteTo(stream);
            }
        }
Beispiel #3
0
        // Token: 0x06001058 RID: 4184 RVA: 0x00013C9C File Offset: 0x00011E9C
        public static LuckyDrawSetUnityView Deserialize(Stream bytes)
        {
            int num = Int32Proxy.Deserialize(bytes);
            LuckyDrawSetUnityView luckyDrawSetUnityView = new LuckyDrawSetUnityView();

            luckyDrawSetUnityView.CreditsAttributed    = Int32Proxy.Deserialize(bytes);
            luckyDrawSetUnityView.ExposeItemsToPlayers = BooleanProxy.Deserialize(bytes);
            luckyDrawSetUnityView.Id = Int32Proxy.Deserialize(bytes);
            if ((num & 1) != 0)
            {
                luckyDrawSetUnityView.ImageUrl = StringProxy.Deserialize(bytes);
            }
            luckyDrawSetUnityView.LuckyDrawId = Int32Proxy.Deserialize(bytes);
            if ((num & 2) != 0)
            {
                luckyDrawSetUnityView.LuckyDrawSetItems = ListProxy <BundleItemView> .Deserialize(bytes, new ListProxy <BundleItemView> .Deserializer <BundleItemView>(BundleItemViewProxy.Deserialize));
            }
            luckyDrawSetUnityView.PointsAttributed = Int32Proxy.Deserialize(bytes);
            luckyDrawSetUnityView.SetWeight        = Int32Proxy.Deserialize(bytes);
            return(luckyDrawSetUnityView);
        }
        public static void Serialize(Stream stream, LuckyDrawSetUnityView instance)
        {
            int mask = 0;

            using (var bytes = new MemoryStream())
            {
                Int32Proxy.Serialize(bytes, instance.CreditsAttributed);
                BooleanProxy.Serialize(bytes, instance.ExposeItemsToPlayers);
                Int32Proxy.Serialize(bytes, instance.Id);

                if (instance.ImageUrl != null)
                {
                    StringProxy.Serialize(bytes, instance.ImageUrl);
                }
                else
                {
                    mask |= 1;
                }

                Int32Proxy.Serialize(bytes, instance.LuckyDrawId);

                if (instance.LuckyDrawSetItems != null)
                {
                    ListProxy <BundleItemView> .Serialize(bytes, instance.LuckyDrawSetItems, BundleItemViewProxy.Serialize);
                }
                else
                {
                    mask |= 2;
                }

                Int32Proxy.Serialize(bytes, instance.PointsAttributed);
                Int32Proxy.Serialize(bytes, instance.SetWeight);
                Int32Proxy.Serialize(stream, ~mask);
                bytes.WriteTo(stream);
            }
        }