Added ModulLoader
This commit is contained in:
@@ -0,0 +1,441 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Firebird2D.Datatypes
|
||||
{
|
||||
public enum FirebirdEvent
|
||||
{
|
||||
A = 0,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The B key
|
||||
B = 1,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The C key
|
||||
C = 2,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The D key
|
||||
D = 3,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The E key
|
||||
E = 4,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The F key
|
||||
F = 5,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The G key
|
||||
G = 6,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The H key
|
||||
H = 7,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The I key
|
||||
I = 8,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The J key
|
||||
J = 9,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The K key
|
||||
K = 10,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The L key
|
||||
L = 11,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The M key
|
||||
M = 12,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The N key
|
||||
N = 13,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The O key
|
||||
O = 14,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The P key
|
||||
P = 15,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The Q key
|
||||
Q = 16,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The R key
|
||||
R = 17,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The S key
|
||||
S = 18,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The T key
|
||||
T = 19,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The U key
|
||||
U = 20,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The V key
|
||||
V = 21,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The W key
|
||||
W = 22,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The X key
|
||||
X = 23,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The Y key
|
||||
Y = 24,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The Z key
|
||||
Z = 25,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The 0 key
|
||||
Num0 = 26,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The 1 key
|
||||
Num1 = 27,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The 2 key
|
||||
Num2 = 28,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The 3 key
|
||||
Num3 = 29,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The 4 key
|
||||
Num4 = 30,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The 5 key
|
||||
Num5 = 31,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The 6 key
|
||||
Num6 = 32,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The 7 key
|
||||
Num7 = 33,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The 8 key
|
||||
Num8 = 34,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The 9 key
|
||||
Num9 = 35,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The Escape key
|
||||
Escape = 36,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The left Control key
|
||||
LControl = 37,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The left Shift key
|
||||
LShift = 38,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The left Alt key
|
||||
LAlt = 39,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The left OS specific key: window (Windows and Linux), apple (macOS), ...
|
||||
LSystem = 40,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The right Control key
|
||||
RControl = 41,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The right Shift key
|
||||
RShift = 42,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The right Alt key
|
||||
RAlt = 43,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The right OS specific key: window (Windows and Linux), apple (macOS), ...
|
||||
RSystem = 44,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The Menu key
|
||||
Menu = 45,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The [ key
|
||||
LBracket = 46,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The ] key
|
||||
RBracket = 47,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The ; key
|
||||
Semicolon = 48,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The , key
|
||||
Comma = 49,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The . key
|
||||
Period = 50,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The ' key
|
||||
Apostrophe = 51,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The / key
|
||||
Slash = 52,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The \ key
|
||||
Backslash = 53,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The ~ key
|
||||
Grave = 54,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The = key
|
||||
Equal = 55,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The - key
|
||||
Hyphen = 56,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The Space key
|
||||
Space = 57,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The Return key
|
||||
Enter = 58,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The Backspace key
|
||||
Backspace = 59,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The Tabulation key
|
||||
Tab = 60,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The Page up key
|
||||
PageUp = 61,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The Page down key
|
||||
PageDown = 62,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The End key
|
||||
End = 63,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The Home key
|
||||
Home = 64,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The Insert key
|
||||
Insert = 65,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The Delete key
|
||||
Delete = 66,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The + key
|
||||
Add = 67,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The - key
|
||||
Subtract = 68,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The * key
|
||||
Multiply = 69,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The / key
|
||||
Divide = 70,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// Left arrow
|
||||
Left = 71,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// Right arrow
|
||||
Right = 72,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// Up arrow
|
||||
Up = 73,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// Down arrow
|
||||
Down = 74,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The numpad 0 key
|
||||
Numpad0 = 75,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The numpad 1 key
|
||||
Numpad1 = 76,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The numpad 2 key
|
||||
Numpad2 = 77,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The numpad 3 key
|
||||
Numpad3 = 78,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The numpad 4 key
|
||||
Numpad4 = 79,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The numpad 5 key
|
||||
Numpad5 = 80,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The numpad 6 key
|
||||
Numpad6 = 81,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The numpad 7 key
|
||||
Numpad7 = 82,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The numpad 8 key
|
||||
Numpad8 = 83,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The numpad 9 key
|
||||
Numpad9 = 84,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The F1 key
|
||||
F1 = 85,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The F2 key
|
||||
F2 = 86,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The F3 key
|
||||
F3 = 87,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The F4 key
|
||||
F4 = 88,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The F5 key
|
||||
F5 = 89,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The F6 key
|
||||
F6 = 90,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The F7 key
|
||||
F7 = 91,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The F8 key
|
||||
F8 = 92,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The F9 key
|
||||
F9 = 93,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The F10 key
|
||||
F10 = 94,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The F11 key
|
||||
F11 = 95,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The F12 key
|
||||
F12 = 96,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The F13 key
|
||||
F13 = 97,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The F14 key
|
||||
F14 = 98,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The F15 key
|
||||
F15 = 99,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The Pause key
|
||||
Pause = 100,
|
||||
|
||||
MouseLeft = 101,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The right mouse button
|
||||
MouseRight = 102,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The middle (wheel) mouse button
|
||||
MouseMiddle = 103,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The first extra mouse button
|
||||
MouseXButton1 = 104,
|
||||
//
|
||||
// Zusammenfassung:
|
||||
// The second extra mouse button
|
||||
MouseXButton2 = 105,
|
||||
JoystickButton,
|
||||
JoystickMove,
|
||||
Tick,
|
||||
Startup,
|
||||
ModulesLoading,
|
||||
SceneLoading,
|
||||
FullyLoaded,
|
||||
SceneLoaded,
|
||||
MouseWheel,
|
||||
MouseMove
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Firebird2D.Datatypes
|
||||
{
|
||||
public enum ModuleType
|
||||
{
|
||||
Extension = 0,
|
||||
EventSystem = 1,
|
||||
KeyMapper = 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Firebird2D.Datatypes;
|
||||
using Firebird2D.Interfaces;
|
||||
|
||||
namespace Firebird2D.Interfaces
|
||||
{
|
||||
public interface IEventBus
|
||||
{
|
||||
public void OnPipelineIsBuild(Action<IPipeline> callback, FirebirdEvent firebirdEvent);
|
||||
|
||||
public IPipeline GetOrBuildPipeline(FirebirdEvent type, Type argsType, object master);
|
||||
|
||||
public IPipeline? GetPipeline(FirebirdEvent type, Type argsType);
|
||||
|
||||
public void DestroyPipeline(FirebirdEvent type, object master);
|
||||
}
|
||||
}
|
||||
@@ -9,5 +9,6 @@ namespace Firebird2D.Interfaces
|
||||
{
|
||||
public interface IGame
|
||||
{
|
||||
public IEventBus EventBus { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Firebird2D.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for the Firebird event Pipeline
|
||||
/// </summary>
|
||||
public interface IPipeline
|
||||
{
|
||||
/// <summary>
|
||||
/// Class witch owns the Pipeline and has the right to send events or delete the pipeline
|
||||
/// </summary>
|
||||
object PipelineMaster { get; }
|
||||
/// <summary>
|
||||
/// Check if no one subscribed to the event
|
||||
/// </summary>
|
||||
bool IsEventEmpty { get; }
|
||||
/// <summary>
|
||||
/// Subscribe to this event Pipeline
|
||||
/// </summary>
|
||||
/// <param name="handler">Handler witch should be Invoked when the event is send</param>
|
||||
void Subscribe(Delegate handler);
|
||||
|
||||
/// <summary>
|
||||
/// Unsubscribe from this event Pipeline
|
||||
/// </summary>
|
||||
/// <param name="handler">Handler witch should be removed from the Pipeline</param>
|
||||
void Unsubscribe(Delegate handler);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user