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