mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
First commit
This commit is contained in:
32
client/src/plugin/plugin.ts
Normal file
32
client/src/plugin/plugin.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { OlympusApp } from "../olympusapp";
|
||||
|
||||
export interface PluginInterface {
|
||||
}
|
||||
|
||||
export abstract class Plugin {
|
||||
|
||||
#olympusApp!:OlympusApp;
|
||||
protected name = "";
|
||||
|
||||
constructor( olympusApp:OlympusApp, pluginName:string ) {
|
||||
|
||||
const regex = "^[a-zA-Z][a-zA-Z\d]{4,}"
|
||||
|
||||
if ( new RegExp( regex ).test( pluginName ) === false ) {
|
||||
throw new Error( `Plugin names must match regex: ${regex}` );
|
||||
}
|
||||
|
||||
this.name = pluginName;
|
||||
this.#olympusApp = olympusApp;
|
||||
|
||||
}
|
||||
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
getOlympusApp() {
|
||||
return this.#olympusApp;
|
||||
}
|
||||
|
||||
}
|
||||
13
client/src/plugin/pluginmanager.ts
Normal file
13
client/src/plugin/pluginmanager.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { OlympusApp } from "../olympusapp";
|
||||
import { Manager } from "../other/manager";
|
||||
|
||||
|
||||
export class PluginManager extends Manager {
|
||||
|
||||
constructor( olympusApp:OlympusApp ) {
|
||||
|
||||
super( olympusApp );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user