public void ScreenCapturePositions() { var bmp = new Bitmap("RankedDetection/TestFiles/Screen768_8-8.jpg"); var rd = RankDetection.Match(bmp).Result; Assert.IsTrue(rd.Success); Assert.AreEqual(8, rd.Player); Assert.AreEqual(8, rd.Opponent); }
static void Main(string[] args) { if (args.Length == 3) { if (args[0].ToLower() == "create") { RankTemplate.Create(args[1], args[2]); } else if (args[0].ToLower() == "match") { RankDetection.SetTemplateLocation(args[1]); var match = RankDetection.Match(new Bitmap(args[2]), true); System.Console.WriteLine(match); } } }
public void RankedFriendsList_IsNotSuccessful() { var result = RankDetection.Match(new Bitmap(@"data\HsGameRankedFriends.png")); Assert.IsFalse(result.Success); }
public void MenuB_IsNotSuccessful() { var result = RankDetection.Match(new Bitmap(@"data\HsMenuB.png")); Assert.IsFalse(result.Success); }
public void NonRankedGame_IsNotSuccessful() { var result = RankDetection.Match(new Bitmap(@"data\HsGameAi.png")); Assert.IsFalse(result.Success); }
// Helper Methods private bool TestCapture(string height, int ply = 8, int opp = 8) { var result = RankDetection.Match(new Bitmap(@"data\Height_" + height + ".png")); return(result.Player == ply && result.Opponent == opp); }
public static void Setup(TestContext context) { _result = RankDetection.Match(new Bitmap(@"data\LegendGame.png")); }
public static void Setup(TestContext context) { _resultHi = RankDetection.Match(new Bitmap(@"data\Ranked_14_14_Hi.png")); _resultLo = RankDetection.Match(new Bitmap(@"data\Ranked_14_14_Lo.png")); }