prepare to send different data per client
This commit is contained in:
parent
fcd84d2c83
commit
fbaad86555
1 changed files with 245 additions and 128 deletions
|
|
@ -1,13 +1,16 @@
|
|||
using DisplayCommands;
|
||||
using TanksServer.GameLogic;
|
||||
|
||||
namespace TanksServer.Graphics;
|
||||
|
||||
internal sealed class DrawBulletsStep(BulletManager bullets) : IDrawStep
|
||||
{
|
||||
public void Draw(PixelGrid buffer)
|
||||
public void Draw(GamePixelGrid pixels)
|
||||
{
|
||||
foreach (var position in bullets.GetAll().Select(b => b.Position.ToPixelPosition()))
|
||||
buffer[(ushort)position.X, (ushort)position.Y] = true;
|
||||
foreach (var bullet in bullets.GetAll())
|
||||
{
|
||||
var position = bullet.Position.ToPixelPosition();
|
||||
pixels[position.X, position.Y].EntityType = GamePixelEntityType.Bullet;
|
||||
pixels[position.X, position.Y].BelongsTo = bullet.Owner;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue