CEngineSharp_Editor.NpcEditor.LoadNpcs C# (CSharp) Method

LoadNpcs() private method

private LoadNpcs ( ) : void
return void
        private void LoadNpcs()
        {
            this.npcListBox.Items.Clear();

            this.npcs = new List<Npc>();

            DirectoryInfo dI = new DirectoryInfo(dataPath + "/Npcs/");

            foreach (var file in dI.GetFiles("*.dat", SearchOption.TopDirectoryOnly))
            {
                this.npcs.Add(Npc.Load(file.FullName));
                this.npcListBox.Items.Add(this.npcs[this.npcs.Count - 1].Name);
            }

            if (this.npcs.Count == 0)
            {
                Npc npc = new Npc();
                npc.Name = "Untitled";
                npc.TextureNumber = 0;
                this.npcs.Add(npc);
                this.npcListBox.Items.Add(npc.Name);
            }

            this.npcListBox.SelectedIndex = 0;

            this.selectedNpc = this.npcs[this.npcListBox.SelectedIndex];

            this.PopulateData();
        }