Exemple #1
0
 public override void SerializeData(TagCompound tag)
 {
     base.SerializeData(tag);
     tag["buffType"] = buffType;
     tag["buffTime"] = TagSerializables.Serialize(buffTime);
     tag["tooltip"]  = tooltip;
 }
Exemple #2
0
 public Affix Deserialize(TagCompound tag)
 {
     try
     {
         return(TagSerializables.Deserialize <Affix>(tag));
     }
     catch (TypeUnloadedException)
     {
         TagCompound dataTag = tag.HasTag("data") ? tag.GetCompound("data") : null;
         return(new UnloadedAffix(tag.GetString("type"), dataTag));
     }
 }
Exemple #3
0
        public TagCompound Serialize(Affix affix)
        {
            UnloadedAffix unloadedAffix = affix as UnloadedAffix;

            if (unloadedAffix == null)
            {
                return(TagSerializables.Serialize(affix));
            }
            else
            {
                TagCompound tag = new TagCompound();
                tag["type"] = unloadedAffix.typeName;
                if (unloadedAffix.tag != null)
                {
                    tag["data"] = unloadedAffix.tag;
                }
                return(tag);
            }
        }
 public override void SerializeData(TagCompound tag)
 {
     tag["hiddenAffix"] = TagSerializables.Serialize(hiddenAffix);
     tag["requirement"] = TagSerializables.Serialize(requirement);
 }