Пример #1
0
        /// <summary>
        /// Creates the object of the specified type.
        /// </summary>
        /// <param name="typeName">Name of the type.</param>
        /// <returns></returns>
        public static object CreateType(BlackbirdGame game, string typeName, params object[] pars)
        {
            Type type = game.TypeManager.GetType(typeName);

            if (type == null)
            {
                throw new BlackbirdException(string.Format(Resources.TypeNotFound, typeName));
            }

            object ret = Activator.CreateInstance(type, pars);

            if (ret == null)
            {
                throw new BlackbirdException(string.Format(Resources.TypeNotInitialized, typeName));
            }

            return(ret);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BasicSimulationComponent"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 /// <param name="id">The id.</param>
 public BasicSimulationComponent(BlackbirdGame game, string id)
 {
     this.Game = game;
     this.Id   = id;
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextureManager"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 public TextureManager(BlackbirdGame game)
 {
     this.Game = game;
 }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextureManager"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 public TypeManager(BlackbirdGame game)
 {
     this.Game = game;
 }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BlackbirdGameInfo"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 public BlackbirdGameInfo(BlackbirdGame game)
 {
     this.Game = game;
 }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameScreenManager"/> class.
 /// </summary>
 /// <param name="game">The game instance.</param>
 public GameScreenManager(BlackbirdGame game)
 {
     this.Game = game;
 }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FontManager"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 public FontManager(BlackbirdGame game)
 {
     this.Game      = game;
     this.innerData = new Dictionary <string, Font>();
 }
Пример #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MouseManager"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 public MouseManager(BlackbirdGame game)
 {
     this.game = game;
 }
Пример #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameScreen"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 public GameScreen(BlackbirdGame game, string faceId)
 {
     this.game   = game;
     this.FaceId = faceId;
 }