Skip to content

Commit

Permalink
- NetProcDataGameController made the Database public static. It is re…
Browse files Browse the repository at this point in the history
…adonly and only a single instance. Service mode will need more access to this at some point.

- adjust incorrect color for Red
  • Loading branch information
horseyhorsey committed Sep 9, 2023
1 parent 52843ab commit e57df10
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnet_nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Publish
uses: softprops/action-gh-release@v1
with:
tag_name: "1.0.37"
tag_name: "1.0.38"
files: "NetProc-*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<VersionSuffix>1.0.37</VersionSuffix>
<VersionSuffix>1.0.38</VersionSuffix>
<AssemblyVersion>$(VersionSuffix)</AssemblyVersion>
<PackageVersion>$(VersionSuffix)</PackageVersion>
<Version>$(VersionSuffix)</Version>
Expand Down
4 changes: 2 additions & 2 deletions Examples/P-ROC/NetProcGameTest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ static void Main(string[] args)
{
if (line == "e")
{
game.FlippersEnabled = true;
game.EnableFlippers(true);
}
if (line == "d")
{
game.FlippersEnabled = false;
game.EnableFlippers(true);
}
if (line == "c")
{
Expand Down
4 changes: 2 additions & 2 deletions Examples/P-ROC/NetProcGameTest/StarterGame/BaseGameMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public override void ModeStarted()
lamp.Enable();

// Enable flippers
Game.FlippersEnabled = true;
Game.EnableFlippers(true);

// Put the ball into play and Start tracking it
//Game.trough.onBallLaunched += new LaunchCallbackHandler(ball_launch_callback);
Expand Down Expand Up @@ -57,7 +57,7 @@ public void ball_launch_callback()
public override void ModeStopped()
{
// Ensure flippers are disabled
Game.FlippersEnabled = false;
Game.EnableFlippers(false);
// Disable ball search
}

Expand Down
2 changes: 1 addition & 1 deletion Examples/P-ROC/NetProcGameTest/StarterGame/StarterGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public override void Reset()
//_modes.Add(_ball_search);

// Disable the flippers
this.FlippersEnabled = false;
this.EnableFlippers(false);
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions Examples/P-ROC/NetProcGameTest/StarterGame/TestMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ public void all_gi_off()

public bool sw_startButton_active(Switch sw)
{
Game.FlippersEnabled = true;
Game.EnableFlippers(true);
Game.Coils["trough"].Pulse();

return SWITCH_CONTINUE;
}

public bool sw_buyIn_active(Switch sw)
{
Game.FlippersEnabled = false;
Game.EnableFlippers(false);
return SWITCH_CONTINUE;
}

Expand Down
2 changes: 1 addition & 1 deletion Examples/P-ROC/NetProcGameTest/TestGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void FindAndEjectBall()
public override void Reset()
{
base.Reset();
this.FlippersEnabled = false;
this.EnableFlippers(false);
}
}
}
2 changes: 1 addition & 1 deletion NetProc.Data/Migrations/20230907234924_AddedColorSets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
migrationBuilder.InsertData(
table: "Colors",
columns: new[] { "Name", "HtmlCode" },
values: new object[] { "RED", "FEFEFE" });
values: new object[] { "RED", "FF0000" });

migrationBuilder.InsertData(
table: "Colors",
Expand Down
5 changes: 3 additions & 2 deletions NetProc.Data/NetProcDataGameController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ namespace NetProc.Data
/// Game controller using <see cref="BaseGameController"/> with an instance to the database <para/>
/// </summary>
public class NetProcDataGameController : BaseGameController
{
static readonly INetProcDbContext Database = new NetProcDbContext();
{
/// <summary> Sqlite Entity Framework Database Context </summary>
public static readonly INetProcDbContext Database = new NetProcDbContext();

private readonly bool deleteOnInit;
private bool _dbInitialized;
Expand Down
2 changes: 1 addition & 1 deletion NetProc.Data/NetProcDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
new ColorSet(){ Name = "BLK", HtmlCode = "010101"},
new ColorSet(){ Name = "WHT", HtmlCode = "FEFEFE"},
new ColorSet(){ Name = "BLU", HtmlCode = "0155FE"},
new ColorSet(){ Name = "RED", HtmlCode = "FEFEFE"},
new ColorSet(){ Name = "RED", HtmlCode = "FF0000"},
new ColorSet(){ Name = "YEL", HtmlCode = "EDFE01"},
new ColorSet(){ Name = "ORG", HtmlCode = "FE9001"},
new ColorSet(){ Name = "GRN", HtmlCode = "3CDF13"},
Expand Down

0 comments on commit e57df10

Please sign in to comment.