public GameObjectMediator(App game) { this._game = game; foreach (Type type in Assembly.GetExecutingAssembly().GetTypes()) { if (GameObjectMediator.GetAssociatedGameObjectType(type).HasValue) { this.RegisterType(type); } } }
private void RegisterType(Type type) { InteropGameObjectType?associatedGameObjectType = GameObjectMediator.GetAssociatedGameObjectType(type); if (!associatedGameObjectType.HasValue) { throw new InvalidOperationException("No associated game object type for " + (object)type + "."); } this._forwardTypeMap.Add(type, associatedGameObjectType.Value); this._reverseTypeMap.Add(associatedGameObjectType.Value, type); }