コード例 #1
0
ファイル: AffixMod.cs プロジェクト: Shockah/tModLoader-Mods
        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);
            }
        }
コード例 #2
0
 public void RemoveAffix(Item item, Affix affix)
 {
     affixes.Remove(affix);
 }
コード例 #3
0
ファイル: Extensions.cs プロジェクト: Shockah/tModLoader-Mods
 public static void RemoveAffix(this Item item, Affix affix)
 {
     item.GetAffixInfo()?.RemoveAffix(item, affix);
 }
コード例 #4
0
 public void ApplyAffix(Item item, Affix affix)
 {
     affixes.Add(affix);
 }
コード例 #5
0
ファイル: Extensions.cs プロジェクト: Shockah/tModLoader-Mods
 public static void ApplyAffix(this Item item, Affix affix)
 {
     item.GetAffixInfo()?.ApplyAffix(item, affix);
 }