예제 #1
0
        public override IValue Serialize() =>
#pragma warning disable LAA1002
        new Dictionary(new Dictionary <IKey, IValue>
        {
            [(Text)LegacyNameKey]        = (Text)name,
            [(Text)LegacyCharacterIdKey] = (Integer)characterId,
            [(Text)LegacyLevelKey]       = (Integer)level,
            [(Text)ExpKey]                            = (Integer)exp,
            [(Text)LegacyInventoryKey]                = inventory.Serialize(),
            [(Text)LegacyWorldInformationKey]         = worldInformation.Serialize(),
            [(Text)LegacyUpdatedAtKey]                = updatedAt.Serialize(),
            [(Text)LegacyAgentAddressKey]             = agentAddress.Serialize(),
            [(Text)LegacyQuestListKey]                = questList.Serialize(),
            [(Text)LegacyMailBoxKey]                  = mailBox.Serialize(),
            [(Text)LegacyBlockIndexKey]               = (Integer)blockIndex,
            [(Text)LegacyDailyRewardReceivedIndexKey] = (Integer)dailyRewardReceivedIndex,
            [(Text)LegacyActionPointKey]              = (Integer)actionPoint,
            [(Text)LegacyStageMapKey]                 = stageMap.Serialize(),
            [(Text)LegacyMonsterMapKey]               = monsterMap.Serialize(),
            [(Text)LegacyItemMapKey]                  = itemMap.Serialize(),
            [(Text)LegacyEventMapKey]                 = eventMap.Serialize(),
            [(Text)LegacyHairKey]                     = (Integer)hair,
            [(Text)LensKey]                           = (Integer)lens,
            [(Text)LegacyEarKey]                      = (Integer)ear,
            [(Text)LegacyTailKey]                     = (Integer)tail,
            [(Text)LegacyCombinationSlotAddressesKey] = combinationSlotAddresses
                                                        .OrderBy(i => i)
                                                        .Select(i => i.Serialize())
                                                        .Serialize(),
            [(Text)LegacyNonceKey]             = Nonce.Serialize(),
            [(Text)LegacyRankingMapAddressKey] = RankingMapAddress.Serialize(),
        }.Union((Dictionary)base.Serialize()));
예제 #2
0
        public override IValue Serialize() =>
#pragma warning disable LAA1002
        new Dictionary(new Dictionary <IKey, IValue>
        {
            [(Text)"name"]                     = (Text)name,
            [(Text)"characterId"]              = (Integer)characterId,
            [(Text)"level"]                    = (Integer)level,
            [(Text)"exp"]                      = (Integer)exp,
            [(Text)"inventory"]                = inventory.Serialize(),
            [(Text)"worldInformation"]         = worldInformation.Serialize(),
            [(Text)"updatedAt"]                = updatedAt.Serialize(),
            [(Text)"agentAddress"]             = agentAddress.Serialize(),
            [(Text)"questList"]                = questList.Serialize(),
            [(Text)"mailBox"]                  = mailBox.Serialize(),
            [(Text)"blockIndex"]               = (Integer)blockIndex,
            [(Text)"dailyRewardReceivedIndex"] = (Integer)dailyRewardReceivedIndex,
            [(Text)"actionPoint"]              = (Integer)actionPoint,
            [(Text)"stageMap"]                 = stageMap.Serialize(),
            [(Text)"monsterMap"]               = monsterMap.Serialize(),
            [(Text)"itemMap"]                  = itemMap.Serialize(),
            [(Text)"eventMap"]                 = eventMap.Serialize(),
            [(Text)"hair"]                     = (Integer)hair,
            [(Text)"lens"]                     = (Integer)lens,
            [(Text)"ear"]                      = (Integer)ear,
            [(Text)"tail"]                     = (Integer)tail,
            [(Text)"combinationSlotAddresses"] = combinationSlotAddresses
                                                 .OrderBy(i => i)
                                                 .Select(i => i.Serialize())
                                                 .Serialize(),
            [(Text)"nonce"] = Nonce.Serialize(),
            [(Text)"ranking_map_address"] = RankingMapAddress.Serialize(),
        }.Union((Dictionary)base.Serialize()));
예제 #3
0
        public void Serialize()
        {
            var map = new CollectionMap();

            map.Add(1, 1);
            map.Add(2, 1);

            var map2 = new CollectionMap();

            map2.Add(2, 1);
            map2.Add(1, 1);

            var deserialized = new CollectionMap((Dictionary)map2.Serialize());

            Assert.Equal(deserialized, map);
        }