Skip to content

Commit 3f8266f

Browse files
committedFeb 28, 2024·
Fixed formatting 4
1 parent 7f862f9 commit 3f8266f

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed
 

‎.editorconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ ij_yaml_spaces_within_brackets = true
224224
indent_size = 2
225225
tab_width = 2
226226

227-
[*.{manifest,nuspec,sln}]
227+
[*.{manifest,sln,nuspec}]
228228
indent_size = unset
229229
tab_width = unset
230230
max_line_length = unset
@@ -233,7 +233,7 @@ insert_final_newline = unset
233233
[*.{json,csproj,Config}]
234234
insert_final_newline = unset
235235

236-
[*.{appxmanifest,asax,ascx,aspx,axaml,build,c,c++,cc,cginc,compute,cp,cpp,cppm,cs,cshtml,cu,cuh,cxx,dtd,fs,fsi,fsscript,fsx,fx,fxh,h,hh,hlsl,hlsli,hlslinc,hpp,hxx,inc,inl,ino,ipp,ixx,master,ml,mli,mpp,mq4,mq5,mqh,nuspec,paml,razor,resw,resx,shader,skin,tpp,usf,ush,vb,xaml,xamlx,xoml,xsd}]
236+
[*.{appxmanifest,asax,ascx,aspx,axaml,build,c,c++,cc,cginc,compute,cp,cpp,cppm,cs,cshtml,cu,cuh,cxx,dtd,fs,fsi,fsscript,fsx,fx,fxh,h,hh,hlsl,hlsli,hlslinc,hpp,hxx,inc,inl,ino,ipp,ixx,master,ml,mli,mpp,mq4,mq5,mqh,paml,razor,resw,resx,shader,skin,tpp,usf,ush,vb,xaml,xamlx,xoml,xsd}]
237237
indent_style = space
238238
indent_size = 4
239239
tab_width = 4

‎GREngine.Core/GREngine.Core.Physics2D/PolygonCollider.cs

+5
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ public override void SolveCollision(PolygonCollider other, Vector2 velocity)
196196
//otherwise, find vector from vertex to intersection point
197197
// and add it to list of possible motion vectors
198198
Vector2 collisionVector = new Vector2(v.X - intersectionPoint.X, v.Y - intersectionPoint.Y);
199+
199200
if (!velocityTowardsCollision) {
200201
collisionVector = new Vector2(intersectionPoint.X - v.X, intersectionPoint.Y - v.Y);
201202
}
@@ -253,6 +254,7 @@ public override void SolveCollision(PolygonCollider other, Vector2 velocity)
253254
//otherwise, find vector from vertex to intersection point
254255
// and add it to list of possible motion vectors
255256
Vector2 collisionVector = new Vector2(intersectionPoint.X - v.X, intersectionPoint.Y - v.Y);
257+
256258
if (!velocityTowardsCollision) {
257259
collisionVector = new Vector2(v.X - intersectionPoint.X, v.Y - intersectionPoint.Y);
258260
}
@@ -330,9 +332,11 @@ public override void SolveCollision(CircleCollider other, Vector2 velocity)
330332
PointF p1 = new PointF(vertex.X + directionVector.X, vertex.Y + directionVector.Y);
331333
PointF p2 = new PointF(vertex.X + (directionVector.X * -1), vertex.Y + (directionVector.Y * -1));
332334
List<PointF> intersections = collisionSystem.LineIntersectsCircle(p1, p2, circCenter, circRadius);
335+
333336
if (collisionSystem.PointIsInAABB(intersections[0], overlapRegion))
334337
{
335338
Vector2 collisionVector = new Vector2(vertex.X - intersections[0].X, vertex.Y - intersections[0].Y);
339+
336340
if (!velocityTowardsCollision) {
337341
collisionVector = new Vector2(intersections[0].X - vertex.X, intersections[0].Y - vertex.Y);
338342
}
@@ -342,6 +346,7 @@ public override void SolveCollision(CircleCollider other, Vector2 velocity)
342346
{
343347
Vector2 collisionVector = new Vector2(
344348
vertex.X - intersections[1].X, vertex.Y - intersections[1].Y);
349+
345350
if (!velocityTowardsCollision) {
346351
collisionVector = new Vector2(intersections[1].X - vertex.X, intersections[1].Y - vertex.Y);
347352
}

‎GREngine.Core/GREngine.Core.System/SceneGraph/SceneManager.cs

+12-6
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ public override void Update(GameTime gameTime)
7070
{
7171
IEnumerable<Attribute> attrs = b.GetType().GetTypeInfo().GetCustomAttributes();
7272

73-
Attribute? loadOrderAttribute = attrs.ToList().FindLast(a => a.GetType() == typeof(GRExecutionOrderAttribute));
73+
Attribute? loadOrderAttribute = attrs.ToList().FindLast(
74+
a => a.GetType() == typeof(GRExecutionOrderAttribute));
7475

75-
int loadOrder = loadOrderAttribute == null ? 0 : ((GRExecutionOrderAttribute)loadOrderAttribute).LoadOrder;
76+
int loadOrder = loadOrderAttribute ==
77+
null ? 0 : ((GRExecutionOrderAttribute)loadOrderAttribute).LoadOrder;
7678
b.Initialize(loadOrder, this, this.Game);
7779
});
7880

@@ -87,8 +89,10 @@ public override void Update(GameTime gameTime)
8789
enabledBehaviours.ForEach(b => b.OnStart());
8890

8991
// Add initialized and started scripts to regular update loop (in load order)
90-
// activeBehaviours = Algorithms.Sort.MergeSortedLists(this.activeBehaviours, enabledBehaviours) as List<Behaviour>
91-
// ?? throw new InvalidOperationException("Active behaviour sorting resulted in a null list!");
92+
// activeBehaviours = Algorithms.Sort.MergeSortedLists(
93+
// this.activeBehaviours, enabledBehaviours) as List<Behaviour>
94+
// ?? throw new InvalidOperationException(
95+
// "Active behaviour sorting resulted in a null list!");
9296

9397
enabledBehaviours.ForEach(b => this.activeBehaviours.Add(b));
9498
this.initializationSet.RemoveWhere(b => b.Initialized);
@@ -286,7 +290,8 @@ public void RemoveBehavioursWithTag(Node node, string tag)
286290
void ISceneControllerService.BehaviourEnabledChanged(Behaviour behaviour, bool status)
287291
{ // [DONE]
288292
// add or remove behaviour from active list
289-
// if add, check if initialized, if so, add to and resort active list, otherwise add to initialization list instead
293+
// if add, check if initialized, if so, add to and
294+
// resort active list, otherwise add to initialization list instead
290295
if (status)
291296
{
292297
if (behaviour.Initialized)
@@ -521,7 +526,8 @@ private void PrintChildren(Node node, int depth)
521526
Vector3 position = node.GetLocalPosition();
522527
string format = "{0,10:####0.000}";
523528
PrintLn(
524-
"[" + String.Format(format, position.X) + ", " + String.Format(format, position.Y) + ", " + String.Format(format, position.Z) + "]" +
529+
"[" + String.Format(format, position.X) + ", " +
530+
String.Format(format, position.Y) + ", " + String.Format(format, position.Z) + "]" +
525531
space +
526532
node.GetType().Name + ": '" + node.Name + "' -> [" + components + "]" + " <" + tags + ">"
527533
);

‎GREngine/GREngine.nuspec

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<releaseNotes>This engine is in its alpha stages and is not considered stable</releaseNotes>
1515
<copyright>Copyright (c) 2024 Contraband Software</copyright>
1616
<tags>Game-Engine</tags>
17-
1817
<dependencies>
1918
<group targetFramework="net6.0"/>
2019
</dependencies>
@@ -31,4 +30,4 @@
3130

3231
<!-- <file src="bin\Release\net6.0\*.dll" target="lib\net6.0" />-->
3332
</files>
34-
</package>
33+
</package>

0 commit comments

Comments
 (0)
Please sign in to comment.