BadScript 2
Loading...
Searching...
No Matches
BadReplContext.cs
Go to the documentation of this file.
1
using
BadScript2.ConsoleAbstraction
;
2
using
BadScript2.IO
;
3
namespace
BadScript2.Web.Frontend.Utils
;
4
5
public
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
}
BadScript2.BadRuntime
Exposes the BadScript Runtime Functionality to Consumers.
Definition
BadRuntime.cs:28
BadScript2.Web.Frontend.Utils.BadReplContext
Definition
BadReplContext.cs:6
BadScript2.Web.Frontend.Utils.BadReplContext.Runtime
BadRuntime Runtime
Definition
BadReplContext.cs:11
BadScript2.Web.Frontend.Utils.BadReplContext.OnLoaded
Action OnLoaded
Definition
BadReplContext.cs:7
BadScript2.Web.Frontend.Utils.BadReplContext.Load
void Load(BadRuntime runtime, IBadConsole console, IFileSystem fileSystem)
Definition
BadReplContext.cs:21
BadScript2.Web.Frontend.Utils.BadReplContext.m_OnFileClick
readonly Action< string > m_OnFileClick
Definition
BadReplContext.cs:15
BadScript2.Web.Frontend.Utils.BadReplContext.BadReplContext
BadReplContext(Action< string > mOnFileClick)
Definition
BadReplContext.cs:16
BadScript2.Web.Frontend.Utils.BadReplContext.Console
IBadConsole Console
Definition
BadReplContext.cs:9
BadScript2.Web.Frontend.Utils.BadReplContext.OpenFile
void OpenFile(string file)
BadScript2.Web.Frontend.Utils.BadReplContext.FileSystem
IFileSystem FileSystem
Definition
BadReplContext.cs:13
BadScript2.ConsoleAbstraction.IBadConsole
Interface that abstracts the console.
Definition
IBadConsole.cs:13
BadScript2.IO.IFileSystem
Defines the interface for a file system.
Definition
IFileSystem.cs:7
BadScript2.ConsoleAbstraction
Contains a Console Abstraction Layer to be able to Simulate Console Input/Output over the Network.
Definition
BadConsole.cs:6
BadScript2.IO
Contains IO Implementation for the BadScript2 Runtime.
Definition
BadOpenKmFileSystem.cs:9
BadScript2.Web.Frontend.Utils
Definition
BadReplContext.cs:3
web
BadScript2.Web.Frontend
Utils
BadReplContext.cs
Generated by
1.9.8