mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 15:37:51 -08:00
Add Library-Computer
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SuperStarTrek.Objects;
|
||||
using SuperStarTrek.Space;
|
||||
|
||||
namespace SuperStarTrek.Systems.ComputerFunctions
|
||||
{
|
||||
internal class DirectionDistanceCalculator : NavigationCalculator
|
||||
{
|
||||
private readonly Enterprise _enterprise;
|
||||
private readonly Input _input;
|
||||
|
||||
public DirectionDistanceCalculator(Enterprise enterprise, Output output, Input input)
|
||||
: base("Starbase nav data", output)
|
||||
{
|
||||
_enterprise = enterprise;
|
||||
_input = input;
|
||||
}
|
||||
|
||||
internal override void Execute(Quadrant quadrant)
|
||||
{
|
||||
Output.WriteLine("Direction/distance calculator:")
|
||||
.WriteLine($"You are at quadrant {_enterprise.Quadrant} sector {_enterprise.Sector}")
|
||||
.WriteLine("Please enter");
|
||||
|
||||
WriteDirectionAndDistance(
|
||||
_input.GetCoordinates(" Initial coordinates"),
|
||||
_input.GetCoordinates(" Final coordinates"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user