public static PlayerName GetOutcome(Cards player1, Cards player2, Cards table)
		{
			var p1 = String.Join(" ", player1);
			var p2 = String.Join(" ", player2);
			var tb = String.Join(" ", table);

			var h1 = new Hand(p1, tb);
			var h2 = new Hand(p2, tb);

			if (h1 == h2) { return PlayerName.None; }
			return h1 > h2 ? PlayerName.player1 : PlayerName.player2;
		}
Пример #2
0
		public void TestMoreInstanceOperators()
		{
			string board = "2d kh qh 3h qc";
			// Create a hand with AKs plus board
			Hand h1 = new Hand("ad kd", board);
			// Create a hand with 23 unsuited plus board
			Hand h2 = new Hand("2h 3d", board);
	   
			Assert.IsTrue(h1 > h2);
			Assert.IsTrue(h1 >= h2);
			Assert.IsTrue(h2 <= h1);
			Assert.IsTrue(h2 < h1);
			Assert.IsTrue(h1 != h2);
		}