Fix movement within quadrant

This commit is contained in:
Andrew Cooper
2021-03-21 12:54:14 +11:00
parent 3777f835c1
commit 95ec6a2c02
2 changed files with 7 additions and 0 deletions

View File

@@ -174,6 +174,7 @@ namespace SuperStarTrek.Objects
{
_quadrant = new Quadrant(_quadrant.Galaxy[quadrant], this, _random, _quadrant.Galaxy, _input, _output);
}
_quadrant.SetEnterpriseSector(sector);
SectorCoordinates = sector;
return GetTimeElapsed(quadrant, warpFactor);

View File

@@ -176,5 +176,11 @@ namespace SuperStarTrek.Space
.Select(y => new Coordinates(x, y))
.Select(c => _sectors.GetValueOrDefault(c))
.Select(o => o?.ToString() ?? " "));
internal void SetEnterpriseSector(Coordinates sector)
{
_sectors.Remove(_enterprise.SectorCoordinates);
_sectors[sector] = _enterprise;
}
}
}