diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml new file mode 100644 index 00000000..347cb805 --- /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 diff --git a/src/GameLogic/Snap.cs b/src/GameLogic/Snap.cs index 42894a1a..4886f95b 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! } /// @@ -143,6 +149,7 @@ public void PlayerHit (int player) // stop the game... _started = false; + _gameTimer.Stop (); } #region Snap Game Unit Tests diff --git a/src/SnapGame.cs b/src/SnapGame.cs index ec78e907..35937a10 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 +}