Skip to content

Commit a1c6dc7

Browse files
authored
Refactor readme nuget
Updated minimal project setup code example
1 parent 42ce263 commit a1c6dc7

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

ShapeEngine/readme-nuget.md

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,35 +59,43 @@ using ShapeEngine.Geometry;
5959
using ShapeEngine.Geometry.RectDef;
6060

6161
namespace ShapeEngineProject;
62+
public static class Program
63+
{
64+
public static void Main(string[] args)
65+
{
66+
var game = new MyGameClass
67+
(
68+
GameSettings.StretchMode("Shape Engine Game"),
69+
WindowSettings.Default,
70+
FramerateSettings.Default,
71+
InputSettings.Default
72+
);
73+
game.Run();
74+
}
75+
}
6276

63-
public static class Program
64-
{
65-
public static void Main(string[] args)
66-
{
67-
var game = new MyGameClass(GameSettings.StretchMode("Shape Engine Game"), WindowSettings.Default, InputSettings.Default);
68-
game.Run();
69-
}
70-
}
71-
72-
public class MyGameClass : Game
73-
{
77+
public class MyGameClass : Game
78+
{
7479
//Gives you static access to the instance of MyGameClass - If you do not need/want this, you can remove it.
7580
public new static MyGameClass Instance => myInstance?? throw new NullReferenceException("Instance is not initialized! You need to create a MyGameClass instance before accessing this property!");
7681
private static MyGameClass? myInstance;
7782

78-
public MyGameClass(GameSettings gameSettings, WindowSettings windowSettings, InputSettings inputSettings) : base(gameSettings, windowSettings, inputSettings)
83+
public MyGameClass(
84+
GameSettings gameSettings, WindowSettings windowSettings,
85+
FramerateSettings framerateSettings, InputSettings inputSettings)
86+
: base(gameSettings, windowSettings, framerateSettings, inputSettings)
7987
{
8088
//Game.Instance is already checked to never be instantiated twice, so this is safe
8189
myInstance = GetInstanceAs<MyGameClass>();
8290
}
8391

84-
protected override void DrawGame(ScreenInfo game)
85-
{
86-
game.Area.Draw(new ColorRgba(Color.DarkOliveGreen));
87-
game.Area.DrawLines(12f, new ColorRgba(Color.AntiqueWhite));
88-
game.MousePos.Draw(24f, new ColorRgba(Color.Lime), 36);
89-
}
90-
}
92+
protected override void DrawGame(ScreenInfo game)
93+
{
94+
game.Area.Draw(new ColorRgba(Color.DarkOliveGreen));
95+
game.Area.DrawLines(12f, new ColorRgba(Color.AntiqueWhite));
96+
game.MousePos.Draw(24f, new ColorRgba(Color.Lime), 36);
97+
}
98+
}
9199
```
92100

93101

0 commit comments

Comments
 (0)