From 41f3f64cf9f1dd89e9fdb3601972311ba27539c1 Mon Sep 17 00:00:00 2001
From: victorleezhesheng <36871691+victorleezhesheng@users.noreply.github.com>
Date: Fri, 11 Sep 2020 14:59:38 +0800
Subject: [PATCH 1/4] Create dotnet-core.yml
---
.github/workflows/dotnet-core.yml | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100644 .github/workflows/dotnet-core.yml
diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml
new file mode 100644
index 000000000..347cb805b
--- /dev/null
+++ b/.github/workflows/dotnet-core.yml
@@ -0,0 +1,25 @@
+name: .NET Core
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Setup .NET Core
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: 3.1.301
+ - name: Install dependencies
+ run: dotnet restore
+ - name: Build
+ run: dotnet build --configuration Release --no-restore
+ - name: Test
+ run: dotnet test --no-restore --verbosity normal
From 053ddc06d6f1757e94c3e30f68d1ca78329e0f13 Mon Sep 17 00:00:00 2001
From: Lewis Chin <71061552+xlwschn@users.noreply.github.com>
Date: Tue, 15 Sep 2020 11:53:20 +0800
Subject: [PATCH 2/4] Update Snap.cs
---
src/GameLogic/Snap.cs | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/GameLogic/Snap.cs b/src/GameLogic/Snap.cs
index 42894a1a7..8aecbe106 100644
--- a/src/GameLogic/Snap.cs
+++ b/src/GameLogic/Snap.cs
@@ -37,6 +37,7 @@ public class Snap
public Snap ()
{
_deck = new Deck ();
+ _gameTimer = SwinGame.CreateTimer ();
}
///
@@ -92,6 +93,7 @@ public void Start()
_deck.Shuffle (); // Return the cards and shuffle
FlipNextCard (); // Flip the first card...
+ _gameTimer.Start();
}
}
@@ -111,7 +113,11 @@ public void FlipNextCard()
///
public void Update()
{
- //TODO: implement update to automatically slip cards!
+ if (_gameTimer.Ticks > _flipTime)
+ {
+ _gameTimer.Reset ();
+ FlipNextCard ();
+ }//automatically slip cards!
}
///
From 4522d1e4afb699e4d7447f1b4fc8ebe68c5d37b3 Mon Sep 17 00:00:00 2001
From: Lewis Chin <71061552+xlwschn@users.noreply.github.com>
Date: Tue, 15 Sep 2020 11:56:21 +0800
Subject: [PATCH 3/4] Update SnapGame.cs
---
src/SnapGame.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/SnapGame.cs b/src/SnapGame.cs
index ec78e9072..35937a101 100644
--- a/src/SnapGame.cs
+++ b/src/SnapGame.cs
@@ -25,6 +25,7 @@ private static void HandleUserInput(Snap myGame)
if (SwinGame.KeyTyped (KeyCode.vk_SPACE))
{
myGame.FlipNextCard ();
+ myGame.Start ();
}
}
@@ -86,4 +87,4 @@ public static void Main()
}
}
}
-}
\ No newline at end of file
+}
From 1a64c3fdb41ced5d21c26eaa7c61071d0aa097c4 Mon Sep 17 00:00:00 2001
From: Lewis Chin <71061552+xlwschn@users.noreply.github.com>
Date: Tue, 15 Sep 2020 11:59:18 +0800
Subject: [PATCH 4/4] Update Snap.cs
---
src/GameLogic/Snap.cs | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/GameLogic/Snap.cs b/src/GameLogic/Snap.cs
index 8aecbe106..4886f95bc 100644
--- a/src/GameLogic/Snap.cs
+++ b/src/GameLogic/Snap.cs
@@ -149,6 +149,7 @@ public void PlayerHit (int player)
// stop the game...
_started = false;
+ _gameTimer.Stop ();
}
#region Snap Game Unit Tests