Make mechanism behaviors properly update, fix eating and drinking (#2472)

* Make mechanisms properly update and fix eating and drinking

* Remove outdated component ignores

* Fix nullable error

* Fix mechanism behavior events

* Remove unnecessary code
This commit is contained in:
DrSmugleaf
2020-11-02 11:37:37 +01:00
committed by GitHub
parent 015539dcdc
commit 6b4a39006e
28 changed files with 326 additions and 306 deletions

View File

@@ -2,10 +2,11 @@
using Content.Shared.GameObjects.Components.Body.Mechanism;
using Content.Shared.GameObjects.Components.Body.Part;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Serialization;
namespace Content.Shared.GameObjects.Components.Body.Behavior
{
public interface IMechanismBehavior : IComponent
public interface IMechanismBehavior : IExposeData
{
IBody? Body { get; }
@@ -15,7 +16,20 @@ namespace Content.Shared.GameObjects.Components.Body.Behavior
/// Upward reference to the parent <see cref="IMechanism"/> that this
/// behavior is attached to.
/// </summary>
IMechanism? Mechanism { get; }
IMechanism Parent { get; }
/// <summary>
/// The entity that owns <see cref="Parent"/>.
/// For the entity owning the body that this mechanism may be in,
/// see <see cref="IBody.Owner"/>
/// </summary>
IEntity Owner { get; }
void Initialize(IMechanism parent);
void Startup();
void Update(float frameTime);
/// <summary>
/// Called when the containing <see cref="IBodyPart"/> is attached to a