예제 #1
0
 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);
 }
예제 #2
0
 public static bool IsSubClassOfType(this CharacterObservable obs, params Type[] types)
 {
     return(types.Any(t => obs.GetType().IsInstanceOfType(t)));
 }
예제 #3
0
 public static bool IsSubClassOfType(this CharacterObservable obs, Type parentType)
 {
     return(obs.GetType().IsInstanceOfType(parentType));
 }