function GoldMine( x , z , player )
{
    this.building = new Building( x , z , player , GOLDMINE );
    this.lasttime = Date.now();
    this.goldReward = 1;
}



GoldMine.prototype.update = function()
{
    this.building.update();
    if ( this.building.isDead() ) return;

    if ( Date.now() > this.lasttime+1800 )
    {
        this.building.player.giveGold( this.goldReward );
        this.lasttime = Date.now();
    }
}



GoldMine.prototype.build = function( scene )
{
    var pthis = this;
    this.model = null;
    loadModel( "models/goldmine.glb" , "goldmine" , scene , function( model )
    {
        pthis.model = model;
        pthis.model.position.x = pthis.building.worldPosition.x;
        pthis.model.position.z = pthis.building.worldPosition.y;
        pthis.building.healthBar = new HealthBar( scene , pthis.model , 0.4 , 0.03 , -0.4 );
        for ( var i = 0 ; i < pthis.model._children.length ; ++i )
        {
            pthis.model._children[i].name = pthis.building.ID;
        }
    } );
}



GoldMine.prototype.remove = function()
{
    this.building.b_modelRemoved = true;
    this.model.dispose();
}