More refactors

This commit is contained in:
zumorica
2020-05-20 15:15:17 +02:00
parent fede057bc4
commit 400a71f8a1
4 changed files with 69 additions and 12 deletions

View File

@@ -18,12 +18,17 @@ namespace Content.Server.GameObjects.Components.Instruments
public class InstrumentComponent : SharedInstrumentComponent,
IDropped, IHandSelected, IHandDeselected, IActivate, IUse, IThrown
{
public const int MidiEventsPerSecond = 10;
/// <summary>
/// The client channel currently playing the instrument, or null if there's none.
/// </summary>
private ICommonSession _instrumentPlayer;
private bool _handheld;
private float _timer = 0f;
private int _midiEventCount = 1;
[ViewVariables]
private BoundUserInterface _userInterface;
@@ -57,6 +62,12 @@ namespace Content.Server.GameObjects.Components.Instruments
case InstrumentMidiEventMessage midiEventMsg:
SendNetworkMessage(midiEventMsg);
break;
case InstrumentStartMidiMessage startMidi:
SendNetworkMessage(startMidi);
break;
case InstrumentStopMidiMessage stopMidi:
SendNetworkMessage(stopMidi);
break;
}
}
@@ -124,5 +135,10 @@ namespace Content.Server.GameObjects.Components.Instruments
{
_userInterface.Open(session);
}
public override void Update(float delta)
{
base.Update(delta);
}
}
}