コード例 #1
0
            protected override void Given()
            {
                _position = new PositionBuilder().Build();

                var landingAreaForRocketOne =
                    new LandingAreaMockBuilder()
                    .WithCheckPositionMocked(LandingAnswerForRocketOne, _position)
                    .Build();

                var rocketOne =
                    new RocketBuilder()
                    .WithLandingArea(landingAreaForRocketOne)
                    .Build();

                rocketOne.AskForPosition(_position);

                var landingAreaForRocketTwo =
                    new LandingAreaMockBuilder()
                    .WithCheckPositionMocked(LandingAnswerForRocketTwo, _position)
                    .Build();

                _sut =
                    new RocketBuilder()
                    .WithLandingArea(landingAreaForRocketTwo)
                    .Build();

                _expectedResult = LandingAnswerForRocketTwo;
            }
コード例 #2
0
        public void ParamneterMaxValueTest(double parameterValue, double factor, ParameterType parameterType1, ParameterType parameterType2)
        {
            var rocket = new RocketBuilder();

            rocket.RocketParameters.GetParameter(parameterType1).Value = parameterValue;
            Assert.AreEqual(rocket.RocketParameters.GetParameter(parameterType2).MaxValue, factor * parameterValue);
        }
コード例 #3
0
        public void RocketBuilderBuildsProperRocketTest()
        {
            var rocket = new RocketBuilder();

            var result = rocket.SetProductionYear(1997)
                         .SetBrand("Audi")
                         .SetKerbWeight(1000)
                         .SetColor(Color.Pink)
                         .SetMaxVelosity(300)
                         .Build();

            Assert.AreEqual(1997, result.ProductionYear);
            Assert.AreEqual("Audi", result.Brand);
            Assert.AreEqual(1000, result.KerbWeight);
            Assert.AreEqual(Color.Pink, result.Color);
            Assert.AreEqual(300, result.MaxVelocity);
        }
コード例 #4
0
        protected override void LoadContent()
        {
            spriteBatch       = new SpriteBatch(GraphicsDevice);
            device            = graphics.GraphicsDevice;
            backgroundTexture = Content.Load <Texture2D>("gamebg");
            screenWidth       = device.PresentationParameters.BackBufferWidth;
            screenHeight      = device.PresentationParameters.BackBufferHeight;
            foregroundTexture = Content.Load <Texture2D>("foreground");
            SetUpPlayers();
            armyTexture = Content.Load <Texture2D>("army2");
            Grenade        gre     = new Grenade();
            GrenadeBuilder grenade = new GrenadeBuilder(gre);

            grenade.build();
            Rocket        roc    = new Rocket();
            RocketBuilder rocket = new RocketBuilder(roc);

            rocket.build();
            playerScaling = 40.0f / (float)armyTexture.Width;
        }
コード例 #5
0
ファイル: Game1.cs プロジェクト: inkei18/702451-jacalynckuntz
 protected override void LoadContent()
 {
     
     spriteBatch = new SpriteBatch(GraphicsDevice);
     device = graphics.GraphicsDevice;
     backgroundTexture = Content.Load<Texture2D>("gamebg");
     screenWidth = device.PresentationParameters.BackBufferWidth;
     screenHeight = device.PresentationParameters.BackBufferHeight;
     foregroundTexture = Content.Load<Texture2D>("foreground");
     SetUpPlayers();
     armyTexture = Content.Load<Texture2D>("army2");
     Grenade gre = new Grenade();
     GrenadeBuilder grenade = new GrenadeBuilder(gre);
     grenade.build();
     Rocket roc = new Rocket();
     RocketBuilder rocket = new RocketBuilder(roc);
     rocket.build();
     playerScaling = 40.0f / (float)armyTexture.Width;
     
 }