public void Should_assert_equality_correctly() { HexCoords coords1 = new HexCoords(1, 1); HexCoords coords2 = new HexCoords(1, 1); HexCoords coords3 = new HexCoords(2, 1); Assert.IsTrue(coords1 == coords2); Assert.IsTrue(coords1.Equals(coords2)); Assert.IsTrue(coords1.Equals((object)coords2)); Assert.IsTrue(coords1.Equals(coords1, coords2)); Assert.IsFalse(coords1 == coords3); Assert.IsFalse(coords1.Equals(coords3)); Assert.IsFalse(coords1.Equals(5)); Assert.IsFalse(coords1.Equals(coords1, coords3)); }
public void Hover(HoverEventArgs eventArgs) { // we are still hovering over the same coordinates as last time, // nothing to do if (_lastHover.Equals(_uiState.HoverHexCoords)) { return; } // remove previous indicator _lastHoverTile?.Indicators.Remove(_hoverTileIndicator); // add new indicator _lastHover = _uiState.HoverHexCoords; _lastHoverTile = _uiState.HoverTile; if (_lastHoverTile != null) { _hoverTileIndicator.Position = _lastHoverTile.Position; _lastHoverTile.Indicators.Add(_hoverTileIndicator); } }