Change properties to auto-properties

This commit is contained in:
zumorica
2020-05-20 11:05:55 +02:00
parent e5ddf6e309
commit 1e91b9f075

View File

@@ -48,9 +48,6 @@ namespace Content.Server.GameObjects.Components.Interactable
private SpriteComponent _spriteComponent; private SpriteComponent _spriteComponent;
protected ToolQuality _qualities = ToolQuality.Anchoring; protected ToolQuality _qualities = ToolQuality.Anchoring;
private string _useSound;
private string _useSoundCollection;
private float _speedModifier = 1;
[ViewVariables] [ViewVariables]
public override ToolQuality Qualities public override ToolQuality Qualities
@@ -67,23 +64,11 @@ namespace Content.Server.GameObjects.Components.Interactable
/// For tool interactions that have a delay before action this will modify the rate, time to wait is divided by this value /// For tool interactions that have a delay before action this will modify the rate, time to wait is divided by this value
/// </summary> /// </summary>
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
public float SpeedModifier public float SpeedModifier { get; set; } = 1;
{
get => _speedModifier;
set => _speedModifier = value;
}
public string UseSound public string UseSound { get; set; }
{
get => _useSound;
set => _useSound = value;
}
public string UseSoundCollection public string UseSoundCollection { get; set; }
{
get => _useSoundCollection;
set => _useSoundCollection = value;
}
public void AddQuality(ToolQuality quality) public void AddQuality(ToolQuality quality)
{ {
@@ -123,9 +108,9 @@ namespace Content.Server.GameObjects.Components.Interactable
AddQuality(quality); AddQuality(quality);
} }
} }
serializer.DataField(ref _speedModifier, "speed", 1); serializer.DataField(this, mod => SpeedModifier, "speed", 1);
serializer.DataField(ref _useSound, "useSound", string.Empty); serializer.DataField(this, use => UseSound, "useSound", string.Empty);
serializer.DataField(ref _useSoundCollection, "useSoundCollection", string.Empty); serializer.DataField(this, collection => UseSoundCollection, "useSoundCollection", string.Empty);
} }
public virtual bool UseTool(IEntity user, IEntity target, ToolQuality toolQualityNeeded) public virtual bool UseTool(IEntity user, IEntity target, ToolQuality toolQualityNeeded)