33 lines
768 B
C#
33 lines
768 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace skyscraper5.Skyscraper
|
|
{
|
|
public abstract class Validatable
|
|
{
|
|
private bool? _valid;
|
|
|
|
[JsonIgnore]
|
|
public bool Valid
|
|
{
|
|
get
|
|
{
|
|
if (!_valid.HasValue)
|
|
{
|
|
throw new InvalidOperationException(String.Format("{0} doesn't know whether it's valid. This is a bug, please share a sample of a stream that reproduces this.", this.GetType().FullName));
|
|
}
|
|
|
|
return _valid.Value;
|
|
}
|
|
set
|
|
{
|
|
_valid = value;
|
|
}
|
|
}
|
|
}
|
|
}
|