public CharacterObservable BuildCharacter() { if (_character.Health == null || _character.Stats == null || _character.Direction == default(PlayerDirection) || _character.Position == null || !_character.GetType().IsSubclassOf(typeof(ICharacter))) { throw new NullReferenceException("Base components for character creation cannot be null"); } return(_character); }
public static bool IsSubClassOfType(this CharacterObservable obs, params Type[] types) { return(types.Any(t => obs.GetType().IsInstanceOfType(t))); }
public static bool IsSubClassOfType(this CharacterObservable obs, Type parentType) { return(obs.GetType().IsInstanceOfType(parentType)); }