]> Dogcows Code - chaz/carfire/blobdiff - Project06/CS 3505 Project 06/CS 3505 Project 06/CS 3505/TestHarness.cs
Some bug fixes, including many synchronization issues.
[chaz/carfire] / Project06 / CS 3505 Project 06 / CS 3505 Project 06 / CS 3505 / TestHarness.cs
index 76bc066fb1ba636bd2b2a19ef4dc0578cba89762..b4860a475d6a08d144056c9fbdc6fe8684ac92b9 100644 (file)
@@ -224,12 +224,14 @@ namespace CS_3505_Project_06.CS_3505
 \r
         public void ResetGame(Object[] playerIdentifiers, Object thisPlayer)\r
         {\r
-            if (playerIdentifiers.Length != 4)\r
-                throw new Exception("This game requires four players.");\r
+            //if (playerIdentifiers.Length != 4)\r
+            //    throw new Exception("This game requires four players.");\r
 \r
             // Copy the player identifiers - do not rely on the array parameter not changing.\r
 \r
-            for (int i = 0; i < 4; i++)\r
+            // Now the test harness will at least run with less than 4 players...\r
+            int numPlayers = playerIdentifiers.Count();\r
+            for (int i = 0; i < numPlayers; i++)\r
                 this.playerIdentifiers[i] = playerIdentifiers[i];\r
 \r
             // Create new game state and inputs objects.\r
@@ -292,6 +294,10 @@ namespace CS_3505_Project_06.CS_3505
 \r
         public long Update(TimeSpan elapsedTime)\r
         {\r
+            // Draw() can be called multiple times between updates, so moved this here to avoid\r
+            // duplicate lines.\r
+            Console.WriteLine("Frame: " + state.frameNumber + " Checksum: " + state.Checksum);\r
+\r
             state.advanceFrame(inputs, elapsedTime.Milliseconds);  // Apply the inputs, advance game state.\r
 \r
             inputs = new NextInputs();  // Start with inputs cleared on the next frame.\r
This page took 0.022713 seconds and 4 git commands to generate.