Esempio n. 1
0
        public void UpdateInternal_does_nothing()
        {
            var position = new Vector2(12f, 5.5f);
            var sun = new Sun(position, 30f, Color.Goldenrod, 200f);

            sun.Update(new GameTime());
        }
Esempio n. 2
0
        public void Draw_does_nothing()
        {
            var position = new Vector2(12f, 5.5f);
            var sun = new Sun(position, 30f, Color.Goldenrod, 200f);

            sun.Draw(null);
        }
Esempio n. 3
0
        public void Sun_can_be_created_and_its_properties_are_set_in_the_constructor()
        {
            var position = new Vector2(12f, 5.5f);
            var sun = new Sun(position, 30f, Color.Goldenrod, 200f);

            Assert.AreEqual(position, sun.Position);
            Assert.AreEqual(30f, sun.Radius);
            Assert.AreEqual(Color.Goldenrod, sun.Color);
            Assert.AreEqual(200f, sun.Mass);
        }
        public IGameObject CreateSun(Vector2 position, Color color, float mass)
        {
            var sun = new Sun(position, 25, color, mass)
            {
                Model = _contentManager.Load<Model>("Models/Sun")
            };

            _gravitySimulator.RegisterSource(sun);
            _drawingManager.Register(sun);
            _gameObjects.Add(sun);

            return sun;
        }