Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Пу-пу-пу #34

Merged
merged 6 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ public sealed partial class SolutionRegenerationComponent : Component
/// </summary>
[DataField("nextChargeTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan NextRegenTime = TimeSpan.FromSeconds(0);
public TimeSpan NextRegenTime = TimeSpan.FromSeconds(5);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ public sealed class SolutionRegenerationSystem : EntitySystem
{
[Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
[Dependency] private readonly IGameTiming _timing = default!;
private TimeSpan _updateTime = TimeSpan.Zero;

public override void Update(float frameTime)
{
base.Update(frameTime);

if (_updateTime > _timing.CurTime)
return;
_updateTime = _timing.CurTime + TimeSpan.FromSeconds(0.5);

var query = EntityQueryEnumerator<SolutionRegenerationComponent, SolutionContainerManagerComponent>();
while (query.MoveNext(out var uid, out var regen, out var manager))
Expand Down
Loading