public void UpdatePlatforms() { // We need to duplicate everything to control updates of the launch data manually. LaunchingSegment = new TurnData(_currentTurn.CurrentTurn.Turn, _currentTurn.CurrentTurn.Impulse); LaunchingUnitPosition = _hexVectorUtility.CloneHexVector <HexGridCoordinate>(_launchingUnit.Position); TargetUnitPosition = _hexVectorUtility.CloneHexVector <HexGridCoordinate>(_targetUnit.Position); LaunchingUnitVelocity = _hexVectorUtility.CloneHexVector <RawHexVector>(_launchingUnit.Vectors); TargetUnitVelocity = _hexVectorUtility.CloneHexVector <RawHexVector>(_targetUnit.Vectors); CrossingVector = _hexGridCalculator.GetCrossingVector(LaunchingUnitVelocity, TargetUnitVelocity); TargetDistance = _hexGridCalculator.GetDistance(LaunchingUnitPosition, TargetUnitPosition); CourseOffset = 0; if (AvidVector.IsNullOrZero(TargetDistance)) { TargetDistance = _hexGridCalculator.GetVectorFromBacktracking(LaunchingUnitVelocity, TargetUnitVelocity); OnVerificationRequired(); } else { SubmitBearingVerificationResult(TargetDistance); } }
private void CheckDistance(HexGridCoordinate posA, HexGridCoordinate posB, int distance, AvidRing ring, AvidDirection direction, bool isAbovePlane) { var result = _calculator.GetDistance(posA, posB); result.Magnitude.Should().Be(distance); result.Ring.Should().Be(ring); result.Direction.Should().Be(direction); result.AbovePlane.Should().Be(isAbovePlane); }