Example #1
0
        public static void LoadAll()
        {
            var sw = System.Diagnostics.Stopwatch.StartNew();

            Translation.Load();
            SoundInfo.Load();
            SoundEnvironment.Load();
            ObjectInfo.Load();
            BodyLoc.Load();
            ExpTable.Load();
            LevelType.Load();
            LevelWarpInfo.Load();
            LevelPreset.Load();
            LevelMazeInfo.Load();
            LevelInfo.Load();
            OverlayInfo.Load();
            MissileInfo.Load();
            ItemStat.Load();
            ItemRatio.Load();
            ItemType.Load();
            ItemPropertyInfo.Load();
            ItemSet.Load();
            UniqueItem.Load();
            SetItem.Load();
            TreasureClass.Load();
            MagicAffix.Load();
            CharStatsInfo.Load();
            MonLvl.Load();
            MonPreset.Load();
            MonSound.Load();
            MonStatsExtended.Load();
            MonStat.Load();
            SuperUnique.Load();
            SkillDescription.Load();
            SkillInfo.Load();
            SpawnPreset.Load();
            StateInfo.Load();
            Debug.Log("All txt files loaded in " + sw.ElapsedMilliseconds + " ms");
        }
Example #2
0
        /// <summary>
        /// Creates a new sound based with a particular name.
        /// If one already exists, returns the existing ID.
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public int CreateSound(string name)
        {
            // See if this texture has already been recorded
            SoundInfo soundInfo = null;
            int       maxID     = 0;

            foreach (SoundInfo info in mSounds)
            {
                if (info.Name == name)
                {
                    soundInfo = info;
                    break;
                }

                if (info.ID > maxID)
                {
                    maxID = info.ID;
                }
            }

            // If the texture has not been recorded, do so now.
            if (soundInfo == null)
            {
                // Open succeeded, now record the info.
                soundInfo = new SoundInfo();

                soundInfo.ID   = maxID + 1;
                soundInfo.Name = name;

                if (!soundInfo.Load())
                {
                    return(-1);
                }

                mSounds.Add(soundInfo);
            }

            return(soundInfo.ID);
        }