Files
RobustToolbox/Robust.Shared/GameObjects/ComponentState.cs
T
metalgearslothandGitHub 270326e188 Add IComponentState / struct support (#4610)
Still boxes but hey at least the struct dream is real.
2024-01-04 13:42:47 +11:00

44 lines
1.2 KiB
C#

using System;
using Robust.Shared.Serialization;
namespace Robust.Shared.GameObjects
{
[RequiresSerializable]
[Serializable, NetSerializable]
[Virtual]
public class ComponentState : IComponentState
{
}
/// <summary>
/// Represents the state of a component for networking purposes.
/// </summary>
public interface IComponentState
{
}
/// <summary>
/// Interface for components that support delta-states.
/// </summary>
public interface IComponentDeltaState
{
/// <summary>
/// Whether this state is a delta or full state.
/// </summary>
bool FullState { get; }
/// <summary>
/// This function will apply the current delta state to the provided full state, modifying it in the process.
/// </summary>
public void ApplyToFullState(IComponentState fullState);
/// <summary>
/// This function should take in a full state and return a new full state with the current delta applied,
/// WITHOUT modifying the original input state.
/// </summary>
public IComponentState CreateNewFullState(IComponentState fullState);
}
}