2021-03-26 12:02:41 +01:00
|
|
|
using System.Collections.Generic;
|
2021-08-21 09:18:23 +02:00
|
|
|
using Content.Server.Nutrition.EntitySystems;
|
2021-09-06 15:49:44 +02:00
|
|
|
using Content.Shared.Chemistry.Components;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.Chemistry.Reagent;
|
2021-08-21 09:18:23 +02:00
|
|
|
using Content.Shared.Nutrition.Components;
|
2021-03-26 12:02:41 +01:00
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
2021-03-26 20:55:14 +01:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
|
2021-03-26 12:02:41 +01:00
|
|
|
|
|
|
|
|
namespace Content.Server.Chemistry.ReagentEntityReactions
|
|
|
|
|
{
|
|
|
|
|
[UsedImplicitly]
|
|
|
|
|
public class WashCreamPieReaction : ReagentEntityReaction
|
|
|
|
|
{
|
|
|
|
|
[DataField("reagents", true, customTypeSerializer:typeof(PrototypeIdHashSetSerializer<ReagentPrototype>))]
|
|
|
|
|
// ReSharper disable once CollectionNeverUpdated.Local
|
|
|
|
|
private readonly HashSet<string> _reagents = new ();
|
|
|
|
|
|
|
|
|
|
protected override void React(IEntity entity, ReagentPrototype reagent, ReagentUnit volume, Solution? source)
|
|
|
|
|
{
|
|
|
|
|
if (!entity.TryGetComponent(out CreamPiedComponent? creamPied) || !_reagents.Contains(reagent.ID)) return;
|
|
|
|
|
|
2021-08-21 09:18:23 +02:00
|
|
|
EntitySystem.Get<CreamPieSystem>().SetCreamPied(entity.Uid, creamPied, false);
|
2021-03-26 12:02:41 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|