| 123456789101112131415161718192021222324252627282930 |
- using System;
- namespace DwarfCorp
- {
- public struct MaybeNull<T> where T: class
- {
- private T _Value;
- public MaybeNull(T _Value)
- {
- this._Value = _Value;
- }
- public static implicit operator MaybeNull<T>(T _Value)
- {
- return new MaybeNull<T>(_Value);
- }
- public bool HasValue(out T Value)
- {
- Value = _Value;
- return _Value != null;
- }
- public bool HasValue()
- {
- return _Value != null;
- }
- }
- }
|