reposition tanks on map switch, rework map logic
This commit is contained in:
parent
3d65c81b8b
commit
97144ae3b8
13 changed files with 208 additions and 117 deletions
|
@ -4,7 +4,8 @@ namespace TanksServer.GameLogic;
|
|||
|
||||
internal sealed class TankSpawnQueue(
|
||||
IOptions<GameRules> options,
|
||||
MapEntityManager entityManager
|
||||
MapEntityManager entityManager,
|
||||
EmptyTileFinder tileFinder
|
||||
) : ITickStep
|
||||
{
|
||||
private readonly ConcurrentQueue<Player> _queue = new();
|
||||
|
@ -25,7 +26,8 @@ internal sealed class TankSpawnQueue(
|
|||
if (!TryDequeueNext(out var player))
|
||||
return ValueTask.CompletedTask;
|
||||
|
||||
entityManager.SpawnTank(player);
|
||||
var position = tileFinder.ChooseEmptyTile().GetCenter().ToFloatPosition();
|
||||
entityManager.SpawnTank(player, position);
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue