package projectzombie.tiles;

import java.util.Random;

import projectzombie.init.Models;
import projectzombie.model.Model;
import projectzombie.util.TileState;

public class TileCactus extends Tile implements TileBulletBreakable
{
	private static final Random rand = new Random();
	
	public TileCactus() {
		
		// Set some settings
		this.tileSolid = true;
		this.tileHitbox = 0.3;
	}
	
	@Override
	public double getLightDissipation(TileState state) {
		return 1/8.0;
	}
	
	@Override
	public int getBulletBreakChance() {
		return 20;
	}

	@Override
	public Model getModel(byte meta) {
		switch(meta)
		{
		case 0: return Models.TILE_CACTUS_1;
		case 1: return Models.TILE_CACTUS_2;
		case 2: return Models.TILE_CACTUS_3;
		case 3: return Models.TILE_CACTUS_4;
		default: return Models.TILE_CACTUS_1;
		}
	}
	
	@Override
	public TileState getDefaultState() {
		return new TileState(this, (byte)(rand.nextDouble() * 4));
	}
	
}
