Initial commit
This commit is contained in:
15
Awperative/Kernel/Events/Behaviors/BehaviorCreateEvent.cs
Normal file
15
Awperative/Kernel/Events/Behaviors/BehaviorCreateEvent.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace Gravity.Kernel;
|
||||
|
||||
public sealed record BehaviorCreateEvent
|
||||
{
|
||||
public readonly Behavior behavior;
|
||||
public readonly Scene scene;
|
||||
|
||||
internal BehaviorCreateEvent() {}
|
||||
|
||||
internal BehaviorCreateEvent(Behavior __behavior, Scene __scene)
|
||||
{
|
||||
behavior = __behavior;
|
||||
scene = __scene;
|
||||
}
|
||||
}
|
||||
15
Awperative/Kernel/Events/Behaviors/BehaviorDestroyEvent.cs
Normal file
15
Awperative/Kernel/Events/Behaviors/BehaviorDestroyEvent.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace Gravity.Kernel;
|
||||
|
||||
public sealed record BehaviorDestroyEvent
|
||||
{
|
||||
public readonly Behavior behavior;
|
||||
public readonly Scene scene;
|
||||
|
||||
internal BehaviorDestroyEvent() {}
|
||||
|
||||
internal BehaviorDestroyEvent(Behavior __behavior, Scene __scene)
|
||||
{
|
||||
behavior = __behavior;
|
||||
scene = __scene;
|
||||
}
|
||||
}
|
||||
15
Awperative/Kernel/Events/Bodies/BodyCreateEvent.cs
Normal file
15
Awperative/Kernel/Events/Bodies/BodyCreateEvent.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace Gravity.Kernel;
|
||||
|
||||
public sealed record BodyCreateEvent
|
||||
{
|
||||
public readonly Body body;
|
||||
public readonly Scene scene;
|
||||
|
||||
internal BodyCreateEvent() {}
|
||||
|
||||
internal BodyCreateEvent(Body __body, Scene __scene)
|
||||
{
|
||||
body = __body;
|
||||
scene = __scene;
|
||||
}
|
||||
}
|
||||
15
Awperative/Kernel/Events/Bodies/BodyDestroyEvent.cs
Normal file
15
Awperative/Kernel/Events/Bodies/BodyDestroyEvent.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace Gravity.Kernel;
|
||||
|
||||
public sealed record BodyDestroyEvent
|
||||
{
|
||||
public readonly Body body;
|
||||
public readonly Scene scene;
|
||||
|
||||
internal BodyDestroyEvent() {}
|
||||
|
||||
internal BodyDestroyEvent(Body __body, Scene __scene)
|
||||
{
|
||||
body = __body;
|
||||
scene = __scene;
|
||||
}
|
||||
}
|
||||
17
Awperative/Kernel/Events/Components/ComponentCreateEvent.cs
Normal file
17
Awperative/Kernel/Events/Components/ComponentCreateEvent.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace Gravity.Kernel;
|
||||
|
||||
public sealed record ComponentCreateEvent
|
||||
{
|
||||
public readonly Component component;
|
||||
public readonly Body body;
|
||||
public readonly Scene scene;
|
||||
|
||||
internal ComponentCreateEvent() {}
|
||||
|
||||
internal ComponentCreateEvent(Component __component, Body __body, Scene __scene)
|
||||
{
|
||||
component = __component;
|
||||
body = __body;
|
||||
scene = __scene;
|
||||
}
|
||||
}
|
||||
17
Awperative/Kernel/Events/Components/ComponentDestroyEvent.cs
Normal file
17
Awperative/Kernel/Events/Components/ComponentDestroyEvent.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace Gravity.Kernel;
|
||||
|
||||
public sealed record ComponentDestroyEvent
|
||||
{
|
||||
public readonly Component component;
|
||||
public readonly Body body;
|
||||
public readonly Scene scene;
|
||||
|
||||
internal ComponentDestroyEvent() {}
|
||||
|
||||
internal ComponentDestroyEvent(Component __component, Body __body, Scene __scene)
|
||||
{
|
||||
component = __component;
|
||||
body = __body;
|
||||
scene = __scene;
|
||||
}
|
||||
}
|
||||
14
Awperative/Kernel/Events/Scenes/SceneCreateEvent.cs
Normal file
14
Awperative/Kernel/Events/Scenes/SceneCreateEvent.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Gravity.Kernel;
|
||||
|
||||
|
||||
public sealed record SceneCreateEvent
|
||||
{
|
||||
public Scene scene;
|
||||
|
||||
internal SceneCreateEvent() {}
|
||||
|
||||
internal SceneCreateEvent(Scene __scene)
|
||||
{
|
||||
scene = __scene;
|
||||
}
|
||||
}
|
||||
14
Awperative/Kernel/Events/Scenes/SceneDestroyEvent.cs
Normal file
14
Awperative/Kernel/Events/Scenes/SceneDestroyEvent.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Gravity.Kernel;
|
||||
|
||||
|
||||
public sealed record SceneDestroyEvent
|
||||
{
|
||||
public Scene scene;
|
||||
|
||||
internal SceneDestroyEvent() {}
|
||||
|
||||
internal SceneDestroyEvent(Scene __scene)
|
||||
{
|
||||
scene = __scene;
|
||||
}
|
||||
}
|
||||
60
Awperative/Kernel/Events/Transform/TransformModifyEvent.cs
Normal file
60
Awperative/Kernel/Events/Transform/TransformModifyEvent.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
|
||||
namespace Gravity.Kernel;
|
||||
|
||||
public sealed record TransformModifyEvent
|
||||
{
|
||||
public readonly Transform before;
|
||||
public readonly Transform after;
|
||||
|
||||
internal TransformModifyEvent() {}
|
||||
|
||||
internal TransformModifyEvent(Transform __before, Transform __after)
|
||||
{
|
||||
before = __before;
|
||||
after = __after;
|
||||
}
|
||||
|
||||
internal static TransformModifyEvent FromTransforms(Transform __previous, Transform __after)
|
||||
{
|
||||
Transform before = __previous;
|
||||
Transform after = new Transform(__after.Origin, __after.Position, __after.Depth, __after.Rotation, __after.Scale);
|
||||
return new TransformModifyEvent(before, after);
|
||||
}
|
||||
|
||||
internal static TransformModifyEvent FromOrigin(Transform __previous, Vector2 __origin)
|
||||
{
|
||||
Transform before = __previous;
|
||||
Transform after = new Transform(__origin, __previous.Position, __previous.Depth, __previous.Rotation, __previous.Scale);
|
||||
return new TransformModifyEvent(before, after);
|
||||
}
|
||||
|
||||
internal static TransformModifyEvent FromPosition(Transform __previous, Vector2 __position)
|
||||
{
|
||||
Transform before = __previous;
|
||||
Transform after = new Transform(__previous.Origin, __position, __previous.Depth, __previous.Rotation, __previous.Scale);
|
||||
return new TransformModifyEvent(before, after);
|
||||
}
|
||||
|
||||
internal static TransformModifyEvent FromDepth(Transform __previous, float __depth)
|
||||
{
|
||||
Transform before = __previous;
|
||||
Transform after = new Transform(__previous.Origin, __previous.Position, __depth, __previous.Rotation, __previous.Scale);
|
||||
return new TransformModifyEvent(before, after);
|
||||
}
|
||||
|
||||
internal static TransformModifyEvent FromRotation(Transform __previous, float __rotation)
|
||||
{
|
||||
Transform before = __previous;
|
||||
Transform after = new Transform(__previous.Origin, __previous.Position, __previous.Depth, __rotation, __previous.Scale);
|
||||
return new TransformModifyEvent(before, after);
|
||||
}
|
||||
|
||||
internal static TransformModifyEvent FromScale(Transform __previous, Vector2 __scale)
|
||||
{
|
||||
Transform before = __previous;
|
||||
Transform after = new Transform(__previous.Origin, __previous.Position, __previous.Depth, __previous.Rotation, __scale);
|
||||
return new TransformModifyEvent(before, after);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user