Пример #1
0
        public string FormatMobsSimple()
        {
            var mobs = new List <MobInfo>();

            for (var i = -65; i < Main.maxNPCTypes; i++)
            {
                var mob  = TShock.Utils.GetNPCById(i);
                var info = new MobInfo(mob.name, mob.life,
                                       mob.damage, mob.defense, mob.type, mob.friendly, mob.townNPC);
                mobs.Add(info);
            }
            var orderedMobs = from x in mobs orderby x.type select x;

            return(JsonConvert.SerializeObject(orderedMobs, Formatting.Indented));
        }
Пример #2
0
 public string FormatMobsSimple()
 {
     var mobs = new List<MobInfo>();
     for (var i = -65; i < Main.maxNPCTypes; i++)
     {
         var mob = TShock.Utils.GetNPCById(i);
         var info = new MobInfo(mob.name, mob.life,
             mob.damage, mob.defense, mob.type, mob.friendly, mob.townNPC);
         mobs.Add(info);
     }
     var orderedMobs = from x in mobs orderby x.type select x;
     return JsonConvert.SerializeObject(orderedMobs, Formatting.Indented);
 }