2020-10-14 15:24:07 +02:00
|
|
|
#nullable enable
|
2020-07-06 14:27:03 -07:00
|
|
|
using Content.Shared.GameObjects.Components;
|
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.GameObjects.Components
|
|
|
|
|
{
|
|
|
|
|
[RegisterComponent]
|
2020-10-14 15:24:07 +02:00
|
|
|
[ComponentReference(typeof(SharedPlaceableSurfaceComponent))]
|
2020-07-06 14:27:03 -07:00
|
|
|
public class PlaceableSurfaceComponent : SharedPlaceableSurfaceComponent
|
|
|
|
|
{
|
2020-10-14 15:24:07 +02:00
|
|
|
private bool _isPlaceable;
|
2020-07-06 14:27:03 -07:00
|
|
|
|
2020-10-14 15:24:07 +02:00
|
|
|
public override bool IsPlaceable
|
|
|
|
|
{
|
|
|
|
|
get => _isPlaceable;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (_isPlaceable == value)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_isPlaceable = value;
|
|
|
|
|
|
|
|
|
|
Dirty();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
|
|
|
|
|
{
|
|
|
|
|
base.HandleComponentState(curState, nextState);
|
|
|
|
|
|
|
|
|
|
if (!(curState is PlaceableSurfaceComponentState state))
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_isPlaceable = state.IsPlaceable;
|
|
|
|
|
}
|
2020-07-06 14:27:03 -07:00
|
|
|
}
|
|
|
|
|
}
|