mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 15:37:51 -08:00
Fix compiler messages
This commit is contained in:
@@ -45,7 +45,7 @@ namespace SuperStarTrek.Utils
|
||||
// 8430 PRINT"DIRECTION =";C1+(((ABS(X)-ABS(A))+ABS(X))/ABS(X)):GOTO8460
|
||||
// 8450 PRINT"DIRECTION =";C1+(ABS(X)/ABS(A))
|
||||
// 8460 PRINT"DISTANCE =";SQR(X^2+A^2):IFH8=1THEN1990
|
||||
private float GetDirection(float deltaX, float deltaY)
|
||||
private static float GetDirection(float deltaX, float deltaY)
|
||||
{
|
||||
var deltaXDominant = Math.Abs(deltaX) > Math.Abs(deltaY);
|
||||
var fractionalPart = deltaXDominant ? deltaY / deltaX : -deltaX / deltaY;
|
||||
@@ -59,7 +59,7 @@ namespace SuperStarTrek.Utils
|
||||
return direction < 1 ? direction + 8 : direction;
|
||||
}
|
||||
|
||||
private float GetDistance(float deltaX, float deltaY) =>
|
||||
private static float GetDistance(float deltaX, float deltaY) =>
|
||||
(float)Math.Sqrt(Math.Pow(deltaX, 2) + Math.Pow(deltaY, 2));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user