示例#1
0
 public GameObjectMediator(App game)
 {
     this._game = game;
     foreach (Type type in Assembly.GetExecutingAssembly().GetTypes())
     {
         if (GameObjectMediator.GetAssociatedGameObjectType(type).HasValue)
         {
             this.RegisterType(type);
         }
     }
 }
示例#2
0
        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);
        }