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

package com.hypixel.hytale.server.core.asset;

import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import javax.annotation.Nonnull;
import java.util.List;
import com.hypixel.hytale.event.IEvent;

public class LoadAssetEvent implements IEvent<Void>
{
    public static final short PRIORITY_LOAD_COMMON = -32;
    public static final short PRIORITY_LOAD_REGISTRY = -16;
    public static final short PRIORITY_LOAD_LATE = 64;
    private final long bootStart;
    @Nonnull
    private final List<String> reasons;
    private boolean shouldShutdown;
    
    public LoadAssetEvent(final long bootStart) {
        this.reasons = new ObjectArrayList<String>();
        this.shouldShutdown = false;
        this.bootStart = bootStart;
    }
    
    public long getBootStart() {
        return this.bootStart;
    }
    
    public boolean isShouldShutdown() {
        return this.shouldShutdown;
    }
    
    @Nonnull
    public List<String> getReasons() {
        return this.reasons;
    }
    
    public void failed(final boolean shouldShutdown, final String reason) {
        this.shouldShutdown |= shouldShutdown;
        this.reasons.add(reason);
    }
    
    @Nonnull
    @Override
    public String toString() {
        return "LoadAssetEvent{bootStart=" + this.bootStart + ", shouldShutdown=" + this.shouldShutdown + ", reasons=" + String.valueOf(this.reasons);
    }
}
