more configuration, limit rate of sent frames
This commit is contained in:
parent
786c974a23
commit
3f4a301993
10 changed files with 104 additions and 45 deletions
|
@ -1,6 +1,10 @@
|
|||
namespace TanksServer.GameLogic;
|
||||
|
||||
internal sealed class CollideBulletsWithMap(BulletManager bullets, MapService map) : ITickStep
|
||||
internal sealed class CollideBulletsWithMap(
|
||||
BulletManager bullets,
|
||||
MapService map,
|
||||
IOptions<GameRulesConfiguration> options
|
||||
) : ITickStep
|
||||
{
|
||||
public Task TickAsync(TimeSpan _)
|
||||
{
|
||||
|
@ -14,7 +18,8 @@ internal sealed class CollideBulletsWithMap(BulletManager bullets, MapService ma
|
|||
if (!map.Current.IsWall(pixel))
|
||||
return false;
|
||||
|
||||
map.Current.DestroyWallAt(pixel);
|
||||
if (options.Value.DestructibleWalls)
|
||||
map.Current.DestroyWallAt(pixel);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
6
TanksServer/GameLogic/GameRulesConfiguration.cs
Normal file
6
TanksServer/GameLogic/GameRulesConfiguration.cs
Normal file
|
@ -0,0 +1,6 @@
|
|||
namespace TanksServer.GameLogic;
|
||||
|
||||
public class GameRulesConfiguration
|
||||
{
|
||||
public bool DestructibleWalls { get; set; } = true;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue