package simogl.gameobjects.building;

import simogl.effect.particle.custom.ChimneySmoke;
import simogl.gameobjects.character.Civilian;
import simogl.level.AbstractLevel;
import simogl.model.building.MD2House;
import simogl.model.character.MD2Civilian;

/**
 * This class represents a house in the game
 * @author Frank Bruns
 *
 */
public class House extends AbstractBuilding
{
	/**
	 * Creates a new house
	 * @param x x-coordinate
	 * @param y y-coordinate
	 * @param z z-coordinate
	 */
	public House(float x, float y, float z)
	{
		super(AbstractBuilding.HOUSE,x,y,z,15,0,1,7);
		this.md2Model = new MD2House(this.getX(),this.getY(),this.getZ());
		this.name = "house";
		this.setFoodConsumptionFactor(1.5f);
		
		this.centerBuildingOnConstructionPoint();
		
		// Add a particle effet to the chimney area
		ChimneySmoke smoke = new ChimneySmoke(this.getX()+2.55f,
				this.getY()+3f, this.getZ()-1.8f,25,700,30);
		this.partEffects.add(smoke);
		AbstractLevel.partEffects.add(smoke);
		
		// add a citizen to the scene
		this.character = new Civilian(this.getX()+this.getModel().getCurrentAnim().getCurrentFrame().getMesh().getBoundingBox().getWidth(),
				this.getY(), this.getZ());
		this.character.getModel().setAnimationState(MD2Civilian.STAND);
		AbstractLevel.characters.add(this.character);
		
		this.increaseNumberInhabitants(1);
	}
}
