This repository was archived by the owner on Sep 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathModule.cs
More file actions
98 lines (80 loc) · 2.78 KB
/
Copy pathModule.cs
File metadata and controls
98 lines (80 loc) · 2.78 KB
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
namespace Foster.Framework;
/// <summary>
/// Foster Module, used to get callbacks during Application Events
/// </summary>
public abstract class Module
{
/// <summary>
/// The Name of the Module
/// </summary>
public string Name;
/// <summary>
/// A lower priority is run first
/// </summary>
protected internal readonly int Priority;
/// <summary>
/// The Application Main Thread ID
/// </summary>
public int MainThreadId { get; internal set; }
/// <summary>
/// Whether the Module has been Registered by the Application
/// </summary>
public bool IsRegistered { get; internal set; }
/// <summary>
/// Whether the Module has been Started by the Application
/// </summary>
public bool IsStarted { get; internal set; }
/// <summary>
/// Creates the Module with the given Priority
/// </summary>
protected Module(int priority = 10000)
{
Name = GetType().Name;
Priority = priority;
}
/// <summary>
/// Called when the Application begins, after the Primary Window is created.
/// If the Application has already started when the module is Registered, this will be called immediately.
/// </summary>
protected internal virtual void Startup() { }
/// <summary>
/// Called when the Application shuts down, or the Module is Removed
/// </summary>
protected internal virtual void Shutdown() { }
/// <summary>
/// Called after the Shutdown method when the Module should be fully Disposed
/// </summary>
protected internal virtual void Disposed() { }
/// <summary>
/// Called at the start of the frame, before Update or Fixed Update.
/// </summary>
protected internal virtual void FrameStart() { }
/// <summary>
/// Called every fixed step
/// </summary>
protected internal virtual void FixedUpdate() { }
/// <summary>
/// Called every variable step
/// </summary>
protected internal virtual void Update() { }
/// <summary>
/// Called at the end of the frame, after Update and Fixed Update.
/// </summary>
protected internal virtual void FrameEnd() { }
/// <summary>
/// Called before any rendering
/// </summary>
protected internal virtual void BeforeRender() { }
/// <summary>
/// Called when a Window is being rendered to, before the Window.OnRender callback
/// </summary>
protected internal virtual void BeforeRenderWindow(Window window) { }
/// <summary>
/// Called when a Window is being rendered to, after the Window.OnRender callback
/// </summary>
protected internal virtual void AfterRenderWindow(Window window) { }
/// <summary>
/// Called after all rendering
/// </summary>
protected internal virtual void AfterRender() { }
}