Beispiel #1
0
        public static FileHandler GetFileHandlerByExtension(string extension)
        {
            FileHandler fileLoader;

            switch(extension.ToLower()) {
                case ".cod":
                    fileLoader = new CockatriceFileHandler();
                    break;

                case ".txt":
                    fileLoader = new MagicOnlineFileHandler();
                    break;

                case ".mwdeck":
                    fileLoader = new MagicWorkstationFileHandler();
                    break;

                case ".dec":
                default:
                    fileLoader = new ApprenticeFileHandler();
                    break;
            }

            return fileLoader;
        }
Beispiel #2
0
        public static FileHandler GetFileHandlerByExtension(string extension)
        {
            FileHandler fileLoader;

            switch (extension.ToLower())
            {
            case ".cod":
                fileLoader = new CockatriceFileHandler();
                break;

            case ".txt":
                fileLoader = new MagicOnlineFileHandler();
                break;

            case ".mwdeck":
                fileLoader = new MagicWorkstationFileHandler();
                break;

            case ".dec":
            default:
                fileLoader = new ApprenticeFileHandler();
                break;
            }

            return(fileLoader);
        }
Beispiel #3
0
        private string GenerateFileContent(Deck deck, FileType fileType)
        {
            FileHandler fileHandler;

            switch(fileType) {
                case FileType.MagicWorkstation:
                    fileHandler = new MagicWorkstationFileHandler();
                    break;

                case FileType.Cockatrice:
                    fileHandler = new CockatriceFileHandler();
                    break;

                case FileType.MagicOnline:
                    fileHandler = new MagicOnlineFileHandler();
                    break;

                case FileType.Apprentice:
                default:
                    fileHandler = new ApprenticeFileHandler();
                    break;
            }

            return fileHandler.Generate(deck);
        }