protected override void UnitUpdate() { timeToLive--; Tile tile = GetComponentInParent <Tile>(); Knight knight = tile.GetComponentInChildren <Knight>(); Inquisitor inquisitor = tile.GetComponentInChildren <Inquisitor>(); Victim victim = tile.GetComponentInChildren <Victim>(); if (knight != null) { knight.terrified = true; knight.enemyLocation.Set(-1, -1); } if (inquisitor != null) { inquisitor.terrified = true; inquisitor.enemyLocation.Set(-1, -1); } if (victim != null) { victim.terrified = true; } if (timeToLive <= 0) { UnitDie(); } }
public void Return_A_Null_sha_When_Ref_Result_Is_Not_Found() { Inquisitor.Arrange(i => i.GetRefForRepo(Arg.AnyString, Arg.AnyString)).Returns(NotfoundRefResult); var firstRepo = Target.GetReposForUser("erikdietrich").First(); Assert.IsNull(firstRepo.Sha); }
public void Return_No_Repositories_For_NotFound_UserId() { Inquisitor.Arrange(i => i.GetRepoSearchResults(Arg.AnyString)).Returns(NotFoundResult); var repos = Target.GetReposForUser("doesntmatter"); Assert.IsFalse(repos.Any()); }
public void Should_Return_Empty_FilesList_When_Tree_Result_Is_Not_Found() { Inquisitor.Arrange(i => i.GetRecursiveTree(Arg.AnyString, Arg.AnyString, Arg.AnyString)).Returns(NotFoundTreeResult); var firstRepo = Target.GetReposForUser("erikdietrich").First(); Assert.AreEqual <int>(0, firstRepo.Files.Count()); }
public void BeforeEachTest() { Inquisitor = Mock.Create <IGithubInquisitor>(); Inquisitor.Arrange(i => i.GetRepoSearchResults(Arg.AnyString)).Returns(SingleResult); Inquisitor.Arrange(i => i.GetRefForRepo(Arg.AnyString, Arg.AnyString)).Returns(RefResult); Inquisitor.Arrange(i => i.GetRecursiveTree(Arg.AnyString, Arg.AnyString, Arg.AnyString)).Returns(ChessTddRecursiveTreeResult); Target = new ProfileSearcher(Inquisitor); }
public void Inquisitor_ShouldWork() { var map = new ListMap(6); var player = new ListPlayer(1, map.Size, new Config()); map.TakeHex(PlayerType.Red, 3, 3); var inquisitor = new Inquisitor(); var testMap = new ListMap(map.Size); testMap.InjectFrom(map); inquisitor.StartInquisition(testMap, player); // Assert.AreEqual(1, 2); }
// Use this for initialization void Start() { this.transform.Find("Model3D").Find("Eye").gameObject.SetActive(false); pivot = transform.Find("Pivot"); inf = this.GetComponent <Informer>(); ask = this.GetComponent <Asker>(); sol = this.GetComponent <Solutioner>(); ul = this.GetComponent <Unlocker>(); inq = this.GetComponent <Inquisitor>(); if (sol != null) { message.transform.Find("Text").GetComponent <TextMesh>().text = sol.answer; } this.name = data.name; message.SetActive(false); }
public void GetPossibleMoves_ShouldGivePriorities_Appropriately() { var map = new ListMap(6); var player = new ListPlayer(1, map.Size, new Config()); var player2 = new ListPlayer(2, map.Size, new Config()); map.TakeHex(PlayerType.Blue, 0, 3); map.TakeHex(PlayerType.Red, 3, 3); map.TakeHex(PlayerType.Blue, 2, 3); map.TakeHex(PlayerType.Red, 3, 2); map.TakeHex(PlayerType.Blue, 1, 3); map.TakeHex(PlayerType.Red, 3, 1); var scout = new Pathfinder(map, player.Me); var redScout = new Pathfinder(map, player2.Me); var path = scout.GetPathForPlayer(); var redPath = redScout.GetPathForPlayer(); var inquisitor = new Inquisitor(); var possibleMovesForBlue = inquisitor.GetPossibleMoves(redPath, path, player.Me, map); TestContext.WriteLine("Blue ========="); foreach (var move in path.Where(x => x.Owner == PlayerType.White)) { TestContext.WriteLine(move); } TestContext.WriteLine("Red ========"); foreach (var move in redPath.Where(x => x.Owner == PlayerType.White)) { TestContext.WriteLine(move); } TestContext.WriteLine("Result ========="); foreach (var move in possibleMovesForBlue) { TestContext.WriteLine(move + " " + move.Priority); } }