예제 #1
0
파일: AllData.cs 프로젝트: Neeef/SODNet
 public static void Update()
 {
     try {
         if (IsDirty)
         {
             EffectTypes = EffectType.GetAllEffectTypes();
             HeroBonuses = HeroBonus.GetAllHeroBonuses();
             Traits      = Trait.GetAllTraits();
             TraitEffect.AddAllTraitEffectsToTraits();
             AmmoTypes          = AmmoType.GetAllAmmoTypes();
             GunTypes           = GunType.GetAllGunTypes();
             Guns               = Gun.GetAllGuns();
             Items              = Item.GetAllItems();
             Maps               = Map.GetAllMaps();
             Sizes              = Size.GetAllSizes();
             Bases              = Base.GetAllBases();
             Facilities         = Facility.GetAllFacilities();
             MeleeTypes         = MeleeType.GetAllMeleeTypes();
             Melees             = Melee.GetAllMelees();
             PrebuiltFacilities = PrebuiltFacility.GetAllPrebuiltFacilities();
             Mods               = Mod.GetAllMods();
             ModFiles           = ModFile.GetAllModFiles();
             AttachPrebuiltsToBases();
             AttachFilesToMods();
             IsDirty = false;
         }
     }
     catch (Exception ex)
     {
         NLog.LogManager.GetCurrentClassLogger().Error(ex, ex.Message + '\n' + ex.StackTrace);
     }
 }
예제 #2
0
        public static Dictionary <int, Melee> GetAllMelees()
        {
            Dictionary <int, Melee> dicMelees = new Dictionary <int, Melee>();
            DataTable dtMelees = MDatabaseUtilities.CreateDataTable("Select * from TMelees ", Hidden.ExternalConnection);

            foreach (DataRow drRow in dtMelees.Rows)
            {
                Melee clsNewMelee = new Melee
                {
                    intID                 = (int)drRow["intMeleeID"],
                    strName               = (string)drRow["strName"],
                    clsMeleeType          = AllData.MeleeTypes[(int)drRow["intMeleeTypeID"]],
                    decWeight             = (decimal)drRow["decWeight"],
                    strScreenshotLocation = (string)drRow["strScreenshotLocation"],
                    intStatusID           = (int)drRow["intStatusID"],
                    intSubmitterID        = (int)drRow["intSubmitterID"]
                };
                dicMelees.Add(clsNewMelee.intID, clsNewMelee);
            }

            return(dicMelees);
        }