Replace VerbTypes with verb classes (#6525)

This commit is contained in:
Leon Friedrich
2022-02-10 15:30:59 +13:00
committed by GitHub
parent 0cd2c2fa9d
commit 1c9ffdc78c
60 changed files with 409 additions and 405 deletions

View File

@@ -45,8 +45,8 @@ namespace Content.Server.PneumaticCannon
SubscribeLocalEvent<PneumaticCannonComponent, ComponentInit>(OnComponentInit);
SubscribeLocalEvent<PneumaticCannonComponent, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<PneumaticCannonComponent, AfterInteractEvent>(OnAfterInteract);
SubscribeLocalEvent<PneumaticCannonComponent, GetAlternativeVerbsEvent>(OnAlternativeVerbs);
SubscribeLocalEvent<PneumaticCannonComponent, GetOtherVerbsEvent>(OnOtherVerbs);
SubscribeLocalEvent<PneumaticCannonComponent, GetVerbsEvent<AlternativeVerb>>(OnAlternativeVerbs);
SubscribeLocalEvent<PneumaticCannonComponent, GetVerbsEvent<Verb>>(OnOtherVerbs);
}
public override void Update(float frameTime)
@@ -285,20 +285,20 @@ namespace Content.Server.PneumaticCannon
return false;
}
private void OnAlternativeVerbs(EntityUid uid, PneumaticCannonComponent component, GetAlternativeVerbsEvent args)
private void OnAlternativeVerbs(EntityUid uid, PneumaticCannonComponent component, GetVerbsEvent<AlternativeVerb> args)
{
if (component.GasTankSlot.ContainedEntities.Count == 0 || !component.GasTankRequired)
return;
if (!args.CanInteract)
return;
Verb ejectTank = new();
AlternativeVerb ejectTank = new();
ejectTank.Act = () => TryRemoveGasTank(component, args.User);
ejectTank.Text = Loc.GetString("pneumatic-cannon-component-verb-gas-tank-name");
args.Verbs.Add(ejectTank);
}
private void OnOtherVerbs(EntityUid uid, PneumaticCannonComponent component, GetOtherVerbsEvent args)
private void OnOtherVerbs(EntityUid uid, PneumaticCannonComponent component, GetVerbsEvent<Verb> args)
{
if (!args.CanInteract)
return;