Пример #1
0
        /// <summary>
        /// Constructs a new instance of the <see cref="GameWorld"/> class, provided all
        /// of it's required dependencies.
        /// </summary>
        /// <param name="controlPad">The human player's controller.</param>
        /// <param name="catRectangle">The rectangle that will be used to represent the Cat.</param>
        /// <param name="catTexture">The texture that will be drawn for the Cat.</param>
        /// <param name="furballRectangle">The rectangle that will be used to represent the Cat's projectile Furball.</param>
        /// <param name="furballTexture">The texture that will be drawn for the Furball.</param>
        /// <param name="alienRectangle">The rectangle that will be used to represent the Alien.</param>
        /// <param name="alienTexture">The texture that will be drawn for the Alien.</param>
        /// <param name="acidRectangle">The rectangle that will be used to represent the Alien's projectile Acid.</param>
        /// <param name="acidTexture">The texture that will be drawn for the Acid.</param>
        public GameWorld(IControlPad controlPad,
                         Rectangle catRectangle, Texture2D catTexture,
                         Rectangle furballRectangle, Texture2D furballTexture,
                         Rectangle alienRectangle, Texture2D alienTexture,
                         Rectangle acidRectangle, Texture2D acidTexture)
        {
            // Setup dependencies
            this._PlayerControlPad = controlPad;
            this._CatRectangle     = catRectangle;
            this._CatTexture       = catTexture;
            this._FurballRectangle = furballRectangle;
            this._FurballTexture   = furballTexture;
            this._AlienRectangle   = alienRectangle;
            this._AlienTexture     = alienTexture;
            this._AcidRectangle    = acidRectangle;
            this._AcidTexture      = acidTexture;

            // Initialize the random instance used to move the Alien.
            this._AlienMoveRandomizer = new Random();
        }
Пример #2
0
        /// <summary>
        /// Constructs a new instance of the <see cref="GameWorld"/> class, provided all
        /// of it's required dependencies.
        /// </summary>
        /// <param name="controlPad">The human player's controller.</param>
        /// <param name="catRectangle">The rectangle that will be used to represent the Cat.</param>
        /// <param name="catTexture">The texture that will be drawn for the Cat.</param>
        /// <param name="furballRectangle">The rectangle that will be used to represent the Cat's projectile Furball.</param>
        /// <param name="furballTexture">The texture that will be drawn for the Furball.</param>
        /// <param name="alienRectangle">The rectangle that will be used to represent the Alien.</param>
        /// <param name="alienTexture">The texture that will be drawn for the Alien.</param>
        /// <param name="acidRectangle">The rectangle that will be used to represent the Alien's projectile Acid.</param>
        /// <param name="acidTexture">The texture that will be drawn for the Acid.</param>
        public GameWorld(IControlPad controlPad, 
            Rectangle catRectangle, Texture2D catTexture, 
            Rectangle furballRectangle, Texture2D furballTexture, 
            Rectangle alienRectangle, Texture2D alienTexture, 
            Rectangle acidRectangle, Texture2D acidTexture)
        {
            // Setup dependencies
            this._PlayerControlPad  = controlPad;
            this._CatRectangle      = catRectangle;
            this._CatTexture        = catTexture;
            this._FurballRectangle  = furballRectangle;
            this._FurballTexture    = furballTexture;
            this._AlienRectangle    = alienRectangle;
            this._AlienTexture      = alienTexture;
            this._AcidRectangle     = acidRectangle;
            this._AcidTexture       = acidTexture;

            // Initialize the random instance used to move the Alien.
            this._AlienMoveRandomizer = new Random();
        }