This repository has been archived by the owner on Jan 4, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 98
/
LuaPlatformAccessorService.cs
executable file
·100 lines (80 loc) · 2.59 KB
/
LuaPlatformAccessorService.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
using MoonSharp.Interpreter;
using MoonSharp.Interpreter.Platforms;
using PixelVision8.Player;
using PixelVision8.Runner;
using PixelVision8.Runner.Workspace;
using System;
using System.IO;
using System.Text;
namespace PixelVision8.Editor
{
public class LuaPlatformAccessorService : AbstractService, IPlatformAccessor
{
private readonly WorkspaceService workspace;
public LuaPlatformAccessorService()
{
// Get reference to the workspace
workspace = locator.GetService(typeof(WorkspaceService).FullName) as WorkspaceService;
}
public CoreModules FilterSupportedCoreModules(CoreModules module)
{
throw new NotImplementedException();
}
public string GetEnvironmentVariable(string envvarname)
{
throw new NotImplementedException();
}
public bool IsRunningOnAOT()
{
throw new NotImplementedException();
}
public string GetPlatformName()
{
throw new NotImplementedException();
}
public void DefaultPrint(string content)
{
// Write print statements directly to the log
workspace.UpdateLog(content);
throw new NotImplementedException();
}
public string DefaultInput(string prompt)
{
throw new NotImplementedException();
}
public Stream IO_OpenFile(Script script, string filename, Encoding encoding, string mode)
{
// TODO need to convert mode to file system mode
return workspace.OpenFile(WorkspacePath.Parse(filename), FileAccess.Read);
}
public Stream IO_GetStandardStream(StandardFileType type)
{
// TODO need to look into what this is
throw new NotImplementedException();
}
public string IO_OS_GetTempFilename()
{
throw new NotImplementedException();
}
public void OS_ExitFast(int exitCode)
{
throw new NotImplementedException();
}
public bool OS_FileExists(string file)
{
return workspace.Exists(WorkspacePath.Parse(file));
}
public void OS_FileDelete(string file)
{
workspace.Delete(WorkspacePath.Parse(file));
}
public void OS_FileMove(string src, string dst)
{
workspace.Move(WorkspacePath.Parse(src), WorkspacePath.Parse(dst));
}
public int OS_Execute(string cmdline)
{
throw new NotImplementedException();
}
}
}