Пример #1
0
        public override IValue Serialize()
        {
#pragma warning disable LAA1002
            return(new Dictionary(new Dictionary <IKey, IValue>
            {
                [(Text)LevelKey] = Level.Serialize(),
                [(Text)ExpiredBlockIndexKey] = ExpiredBlockIndex.Serialize(),
                [(Text)StartedBlockIndexKey] = StartedBlockIndex.Serialize(),
                [(Text)ReceivedBlockIndexKey] = ReceivedBlockIndex.Serialize(),
                [(Text)RewardLevelKey] = RewardLevel.Serialize(),
                [(Text)RewardMapKey] = new Dictionary(
                    RewardMap.Select(
                        kv => new KeyValuePair <IKey, IValue>(
                            (IKey)kv.Key.Serialize(),
                            kv.Value.Serialize()
                            )
                        )
                    ),
                [(Text)EndKey] = End.Serialize(),
                [(Text)RewardLevelMapKey] = new Dictionary(
                    RewardLevelMap.Select(
                        kv => new KeyValuePair <IKey, IValue>(
                            (IKey)kv.Key.Serialize(),
                            new List(kv.Value.Select(v => v.Serialize())).Serialize()
                            )
                        )
                    ),
            }.Union((Dictionary)base.Serialize())));

#pragma warning restore LAA1002
        }
Пример #2
0
        public override IValue SerializeV2()
        {
#pragma warning disable LAA1002
            return(new Dictionary(new Dictionary <IKey, IValue>
            {
                [(Text)LevelKey] = Level.Serialize(),
                [(Text)StartedBlockIndexKey] = StartedBlockIndex.Serialize(),
                [(Text)ReceivedBlockIndexKey] = ReceivedBlockIndex.Serialize(),
            }.Union((Dictionary)base.SerializeV2())));

#pragma warning restore LAA1002
        }