Re-organize all projects (#4166)
This commit is contained in:
34
Content.Server/Cooldown/ItemCooldownSystem.cs
Normal file
34
Content.Server/Cooldown/ItemCooldownSystem.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using Content.Shared.Cooldown;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.Cooldown
|
||||
{
|
||||
public class ItemCooldownSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<ItemCooldownComponent, RefreshItemCooldownEvent>(OnItemCooldownRefreshed);
|
||||
}
|
||||
|
||||
public void OnItemCooldownRefreshed(EntityUid uid, ItemCooldownComponent comp, RefreshItemCooldownEvent args)
|
||||
{
|
||||
comp.CooldownStart = args.LastAttackTime;
|
||||
comp.CooldownEnd = args.CooldownEnd;
|
||||
}
|
||||
}
|
||||
|
||||
public class RefreshItemCooldownEvent : EntityEventArgs
|
||||
{
|
||||
public TimeSpan LastAttackTime { get; }
|
||||
public TimeSpan CooldownEnd { get; }
|
||||
|
||||
public RefreshItemCooldownEvent(TimeSpan lastAttackTime, TimeSpan cooldownEnd)
|
||||
{
|
||||
LastAttackTime = lastAttackTime;
|
||||
CooldownEnd = cooldownEnd;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user