Пример #1
0
            List <string> GetModels(string playerName, Player p)
            {
                var folderPath = playerName == null
                    ? PublicModelsDirectory
                    : StoredCustomModel.GetFolderPath(playerName);

                if (playerName != null && !Directory.Exists(folderPath))
                {
                    p.Message("%WPlayer %S{0} %Whas not created any models.", GetNameWithoutPlus(playerName));
                    return(null);
                }

                var modelNames = new List <string>();

                foreach (var entry in new DirectoryInfo(folderPath).GetFiles())
                {
                    string fileName = entry.Name;
                    if (Path.GetExtension(fileName).CaselessEq(CCModelExt))
                    {
                        string name = Path.GetFileNameWithoutExtension(fileName);
                        modelNames.Add(name);
                    }
                }

                return(modelNames);
            }