using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace TribbleExtinction
{
    public class Tile
    {
        //Texture data

        public int TileType;        

        public double[] tendencies;
              

        public Tile()
        {
            tendencies = new double[4];
            for (int i = 0; i < 4; i++)
                tendencies[i] = 0;
           
        }

        public void regenTile()
        {
            RandomGood rand = Program.game.rand;
            double total = tendencies[0] + tendencies[1] + tendencies[2] + tendencies[3];

            double randValinRange = rand.NextDouble()*total;

            if (randValinRange < tendencies[0])
                TileType = 0;
            else if (randValinRange < tendencies[0] + tendencies[1])
                TileType = 1;
            else if (randValinRange < tendencies[0] + tendencies[1] + tendencies[2])
                TileType = 2;
            else
                TileType = 3;

            for (int i = 0; i < 4; i++)
                tendencies[i] = 0;
        }

        public void render()
        {
        }
    }
}
