mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
* Removed the Interfaces folder. * All objects inside the GameObjects subfolders are now in the GameObjects namespace. * Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces. * Simplified Robust.client.Graphics namespace. * Automated remove redundant using statements.
31 lines
666 B
C#
31 lines
666 B
C#
using System;
|
|
|
|
namespace Robust.Shared.Network
|
|
{
|
|
public struct NetApproval
|
|
{
|
|
public bool IsApproved => _denyReason == null;
|
|
|
|
public string DenyReason => _denyReason != null
|
|
? _denyReason!
|
|
: throw new InvalidOperationException("This was not a denial.");
|
|
|
|
private readonly string? _denyReason;
|
|
|
|
private NetApproval(string? denyReason)
|
|
{
|
|
_denyReason = denyReason;
|
|
}
|
|
|
|
public static NetApproval Deny(string reason)
|
|
{
|
|
return new(reason);
|
|
}
|
|
|
|
public static NetApproval Allow()
|
|
{
|
|
return new(null);
|
|
}
|
|
}
|
|
}
|