예제 #1
0
        private static void ReadContentFolder(GameModeModel model, string folderPath)
        {
            var texturesPath = Path.Combine(folderPath, FolderNameContent, FolderNameTextures);
            FileSystem.GetFilesRecursive(texturesPath, file => model.AddTexture(new TextureModel(texturesPath, file)));

            var modelPath = Path.Combine(folderPath, FolderNameContent, FolderNameModels);
            FileSystem.GetFilesOfFolderRecursive(modelPath, files =>
            {
                if (files.Any(f => (Path.GetExtension(f) ?? "").Equals(".obj", StringComparison.OrdinalIgnoreCase)))
                {
                    model.AddModel(new ModelModel(modelPath, files));
                }
            });
        }
예제 #2
0
        public static GameModeModel Open(string folderPath)
        {
            EnsureDefaultFoldersExists(folderPath);

            var gameMode = new GameModeModel();

            var gameModeFilePath = Path.Combine(folderPath, GameModeJsonFile);
            gameMode.GameModeDataModel = DataModel<DataModel.GameMode.GameModeModel>.FromFile(gameModeFilePath);

            ReadContentFolder(gameMode, folderPath);
            ReadDataFolder(gameMode, folderPath);

            return gameMode;
        }
예제 #3
0
        public static GameModeModel Open(string folderPath)
        {
            EnsureDefaultFoldersExists(folderPath);

            var gameMode = new GameModeModel();

            var gameModeFilePath = Path.Combine(folderPath, GameModeJsonFile);

            gameMode.GameModeDataModel = DataModel <DataModel.GameMode.GameModeModel> .FromFile(gameModeFilePath);

            ReadContentFolder(gameMode, folderPath);
            ReadDataFolder(gameMode, folderPath);

            return(gameMode);
        }
예제 #4
0
        private static void ReadContentFolder(GameModeModel model, string folderPath)
        {
            var texturesPath = Path.Combine(folderPath, FolderNameContent, FolderNameTextures);

            FileSystem.GetFilesRecursive(texturesPath, file => model.AddTexture(new TextureModel(texturesPath, file)));

            var modelPath = Path.Combine(folderPath, FolderNameContent, FolderNameModels);

            FileSystem.GetFilesOfFolderRecursive(modelPath, files =>
            {
                if (files.Any(f => (Path.GetExtension(f) ?? "").Equals(".obj", StringComparison.OrdinalIgnoreCase)))
                {
                    model.AddModel(new ModelModel(modelPath, files));
                }
            });
        }
예제 #5
0
 private static void ReadDataFolder(GameModeModel gameMode, string folderPath)
 {
     FileSystem.GetFiles(Path.Combine(folderPath, FolderNameData, FolderNameMoves), f => gameMode.AddMove(DataModel <MoveModel> .FromFile(f)));
     FileSystem.GetFiles(Path.Combine(folderPath, FolderNameData, FolderNamePokemon), f => gameMode.AddPokemon(DataModel <PokemonModel> .FromFile(f)));
 }
예제 #6
0
 private static void ReadDataFolder(GameModeModel gameMode, string folderPath)
 {
     FileSystem.GetFiles(Path.Combine(folderPath, FolderNameData, FolderNameMoves), f => gameMode.AddMove(DataModel<MoveModel>.FromFile(f)));
     FileSystem.GetFiles(Path.Combine(folderPath, FolderNameData, FolderNamePokemon), f => gameMode.AddPokemon(DataModel<PokemonModel>.FromFile(f)));
 }