// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.server.core.modules.entity.damage;

import javax.annotation.Nonnull;
import com.hypixel.hytale.component.ComponentType;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.component.Component;

public class DeferredCorpseRemoval implements Component<EntityStore>
{
    protected double timeRemaining;
    
    public static ComponentType<EntityStore, DeferredCorpseRemoval> getComponentType() {
        return DamageModule.get().getDeferredCorpseRemovalComponentType();
    }
    
    public DeferredCorpseRemoval(final double timeUntilCorpseRemoval) {
        this.timeRemaining = timeUntilCorpseRemoval;
    }
    
    public boolean tick(final float dt) {
        final double timeRemaining = this.timeRemaining - dt;
        this.timeRemaining = timeRemaining;
        return timeRemaining <= 0.0;
    }
    
    @Nonnull
    @Override
    public Component<EntityStore> clone() {
        return new DeferredCorpseRemoval(this.timeRemaining);
    }
}
