Files
tbd-station-14/Content.Client/Eui/BaseEui.cs
Acruid ca4fd649fe Massive Namespace Cleanup (#3120)
* Engine namespace changes.

* Automated remove redundant using statements.

* Simplified Graphics namespace.

* Apparently the container system stores full type names in the map file.😞 This updates those names.

* API Changes to LocalizationManager.LoadCulture.

* Update submodule to v0.3.2
2021-02-11 01:13:03 -08:00

69 lines
1.7 KiB
C#

using Content.Shared.Eui;
using Content.Shared.Network.NetMessages;
using Robust.Shared.IoC;
using Robust.Shared.Network;
#nullable enable
namespace Content.Client.Eui
{
public abstract class BaseEui
{
[Dependency] private readonly IClientNetManager _netManager = default!;
public EuiManager Manager { get; private set; } = default!;
public uint Id { get; private set; }
protected BaseEui()
{
IoCManager.InjectDependencies(this);
}
internal void Initialize(EuiManager mgr, uint id)
{
Manager = mgr;
Id = id;
}
/// <summary>
/// Called when the EUI is opened by the server.
/// </summary>
public virtual void Opened()
{
}
/// <summary>
/// Called when the EUI is closed by the server.
/// </summary>
public virtual void Closed()
{
}
/// <summary>
/// Called when a new state comes in from the server.
/// </summary>
public virtual void HandleState(EuiStateBase state)
{
}
/// <summary>
/// Called when a message comes in from the server.
/// </summary>
public virtual void HandleMessage(EuiMessageBase msg)
{
}
/// <summary>
/// Send a message to the server-side implementation.
/// </summary>
protected void SendMessage(EuiMessageBase msg)
{
var netMsg = _netManager.CreateNetMessage<MsgEuiMessage>();
netMsg.Id = Id;
netMsg.Message = msg;
_netManager.ClientSendMessage(netMsg);
}
}
}