Aetheria/Assets/Ink/compiler/FileHandler.cs
Reinier Vens 82c8041765 Ink Integration
Initial integration of Ink scripting - simply runs the first story it finds.
2021-04-19 04:35:46 +01:00

24 lines
652 B
C#

using System.IO;
namespace Ink
{
public interface IFileHandler
{
string ResolveInkFilename (string includeName);
string LoadInkFileContents (string fullFilename);
}
public class DefaultFileHandler : Ink.IFileHandler {
public string ResolveInkFilename (string includeName)
{
var workingDir = Directory.GetCurrentDirectory ();
var fullRootInkPath = Path.Combine (workingDir, includeName);
return fullRootInkPath;
}
public string LoadInkFileContents (string fullFilename)
{
return File.ReadAllText (fullFilename);
}
}
}