Esempio n. 1
0
        public Food Get(GraphicsDevice graphicsDevice, ColorDataFactory colorDataFactory)
        {
            var randomPosition = this.positionRandomizer.GenerateRandomPosition();
            var food           = new Food(randomPosition);

            food.Initialize(graphicsDevice, colorDataFactory);
            return(food);
        }
        public override void Initialize()
        {
            this.graphicsDevice = this.game.GraphicsDevice;
            var colorDataFactory = new ColorDataFactory();

            this.arena.Initialize(this.graphicsDevice, colorDataFactory);
            this.eater.Initialize(this.graphicsDevice, colorDataFactory);

            this.availableFood.Add(this.foodFactory.Get(this.graphicsDevice, colorDataFactory));
            this.availableFood.Add(this.foodFactory.Get(this.graphicsDevice, colorDataFactory));
            this.availableFood.Add(this.foodFactory.Get(this.graphicsDevice, colorDataFactory));
        }
Esempio n. 3
0
        public override void Initialize()
        {
            this.graphicsDevice   = this.game.GraphicsDevice;
            this.titleTextures    = new Texture2D[4];
            this.titleTextures[0] = new Texture2D(this.graphicsDevice, singleSquareTextureSize, singleSquareTextureSize * 6);
            this.titleTextures[1] = new Texture2D(this.graphicsDevice, singleSquareTextureSize * 3, singleSquareTextureSize);
            this.titleTextures[2] = new Texture2D(this.graphicsDevice, singleSquareTextureSize * 3, singleSquareTextureSize);
            this.titleTextures[3] = new Texture2D(this.graphicsDevice, singleSquareTextureSize, singleSquareTextureSize * 2);

            var colorDataFactory = new ColorDataFactory();

            this.titleTextures[0].SetData <Color>(colorDataFactory.Get(singleSquareTextureSize * singleSquareTextureSize * 6, Color.Yellow));
            this.titleTextures[1].SetData <Color>(colorDataFactory.Get(singleSquareTextureSize * 3 * singleSquareTextureSize, Color.Yellow));
            this.titleTextures[2].SetData <Color>(colorDataFactory.Get(singleSquareTextureSize * 3 * singleSquareTextureSize, Color.Yellow));
            this.titleTextures[3].SetData <Color>(colorDataFactory.Get(singleSquareTextureSize * singleSquareTextureSize * 2, Color.Yellow));
        }
Esempio n. 4
0
 public override void Initialize(GraphicsDevice graphicsDevice, ColorDataFactory colorDataFactory)
 {
     this.Texture = new Texture2D(graphicsDevice, TextureSize, TextureSize);
     this.Texture.SetData <Color>(colorDataFactory.Get(TextureSize * TextureSize, Color.Red));
 }
Esempio n. 5
0
 public abstract void Initialize(GraphicsDevice graphicsDevice, ColorDataFactory colorDataFactory);
Esempio n. 6
0
 public override void Initialize(GraphicsDevice graphicsDevice, ColorDataFactory colorDataFactory)
 {
     this.Texture = new Texture2D(graphicsDevice, this.Width, this.Heigth);
     this.Texture.SetData <Color>(colorDataFactory.Get(this.Width * this.Heigth, Color.White));
 }