Skip to content

Commit db59ddc

Browse files
committed
feat: Add 'IsEmpty' and 'IsComplete' properties to SandboxId and Deployment respectively.
1 parent b5b3b89 commit db59ddc

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

com.playeveryware.eos/Runtime/Core/Config/Deployment.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ public struct Deployment : IEquatable<Deployment>
3131

3232
public Guid DeploymentId;
3333

34+
/// <summary>
35+
/// Indicates whether a deployment is completely defined or not. A
36+
/// deployment is completely defined if neither the sandbox id nor the
37+
/// deployment id are empty.
38+
/// </summary>
39+
public readonly bool IsComplete
40+
{
41+
get
42+
{
43+
return !DeploymentId.Equals(Guid.Empty) && !SandboxId.IsEmpty;
44+
}
45+
}
46+
3447
public bool Equals(Deployment other)
3548
{
3649
return SandboxId.Equals(other.SandboxId) && DeploymentId.Equals(other.DeploymentId);

com.playeveryware.eos/Runtime/Core/Config/SandboxId.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,21 @@ readonly get
7070
}
7171
}
7272

73+
/// <summary>
74+
/// Indicates whether the sandbox id is empty. A sandbox id is empty if
75+
/// either the underlying value is null or empty, or if the underlying
76+
/// value is equal to the string value for an empty Guid with the dashes
77+
/// removed.
78+
/// </summary>
79+
public readonly bool IsEmpty
80+
{
81+
get
82+
{
83+
return String.IsNullOrEmpty(_value) ||
84+
Guid.Empty.ToString().Replace("-", "").Equals(_value);
85+
}
86+
}
87+
7388
public readonly bool Equals(SandboxId other)
7489
{
7590
return _value == other._value;

0 commit comments

Comments
 (0)