public void TransitionTest() { var target = new Graveyard(); Tile tile = new MockTile(); _control.PlaceTile(tile, _control.GetPlacableSpaces().First()); _control.PlaceTile(target, tile.Space.AdjacentSpaces.First()); Selection actual = target.Transition(null); Assert.AreEqual(Selection.TileFromBoard, actual); actual = target.Transition(tile); Assert.AreEqual(Selection.None, actual); Assert.AreEqual(null, tile.Space); Assert.IsTrue(_control.ActivePlayer.Hand.Contains(tile)); }
private IEnumerable<Plan> DeviseTilePlans(Graveyard tile, IEnumerable<ISpace> spaces) { foreach (ISpace space in spaces) { double value = space.AdjacentTiles.Count(t => t.HasToken(Player)); foreach (ITile adjacentTile in space.AdjacentTiles) { ITile target = adjacentTile; var plan = new Plan(tile, space) {Worths = GameState.Players.ToDictionary(p => p, p => -GetTileWorth(target, p)), Value = value,}; plan.Worths[Player] += GetSpaceWorth(space)+tile.Worth; plan.Arguments.Add(target); yield return plan; } } }