using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace SCJMapper_V2
{
///
/// Finds and returns the Mappings from SC Bundle
/// it is located in the Mappings Path
///
class SCMappings
{
///
/// Returns a list of files found
///
/// A list of filenames - can be empty
static public List MappingNames
{
get
{
List retVal = new List( );
if ( Directory.Exists( SCPath.SCClientMappingPath ) ) {
retVal = ( List )Directory.EnumerateFiles( SCPath.SCClientMappingPath ).ToList();
}
return retVal;
}
}
///
/// Returns the sought default profile as string from GameData.pak
///
/// The filename of the profile to be extracted
/// A string containing the file contents
static public String Mapping( String mappingName )
{
String retVal = "";
String mFile = Path.Combine( SCPath.SCClientMappingPath, ( mappingName + ".xml" ) );
if ( File.Exists( mFile ) ) {
using ( StreamReader sr = new StreamReader( mFile ) ) {
retVal = sr.ReadToEnd( );
}
}
return retVal;
}
}
}