BadScript 2
Loading...
Searching...
No Matches
BadReplContext.cs
Go to the documentation of this file.
2using BadScript2.IO;
4
5public class BadReplContext
6{
7 public event Action OnLoaded = delegate { };
8
9 public IBadConsole Console { get; private set; }
10
11 public BadRuntime Runtime { get; private set; }
12
13 public IFileSystem FileSystem { get; private set; }
14
15 private readonly Action<string> m_OnFileClick;
16 public BadReplContext(Action<string> mOnFileClick)
17 {
18 m_OnFileClick = mOnFileClick;
19 }
20
21 public void Load(BadRuntime runtime, IBadConsole console, IFileSystem fileSystem)
22 {
23 Runtime = runtime;
24 Console = console;
25 FileSystem = fileSystem;
26 OnLoaded.Invoke();
27 }
28
29 public void OpenFile(string file) => m_OnFileClick(file);
30}
Exposes the BadScript Runtime Functionality to Consumers.
Definition BadRuntime.cs:28
void Load(BadRuntime runtime, IBadConsole console, IFileSystem fileSystem)
BadReplContext(Action< string > mOnFileClick)
Interface that abstracts the console.
Defines the interface for a file system.
Definition IFileSystem.cs:7
Contains a Console Abstraction Layer to be able to Simulate Console Input/Output over the Network.
Definition BadConsole.cs:6
Contains IO Implementation for the BadScript2 Runtime.