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

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

import javax.annotation.Nonnull;
import com.hypixel.hytale.server.core.modules.entity.EntityModule;
import com.hypixel.hytale.component.ComponentType;
import com.hypixel.hytale.protocol.ColorLight;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.component.Component;

public class DynamicLight implements Component<EntityStore>
{
    private ColorLight colorLight;
    private boolean isNetworkOutdated;
    
    public static ComponentType<EntityStore, DynamicLight> getComponentType() {
        return EntityModule.get().getDynamicLightComponentType();
    }
    
    public DynamicLight() {
        this.colorLight = new ColorLight();
        this.isNetworkOutdated = true;
    }
    
    public DynamicLight(final ColorLight colorLight) {
        this.colorLight = new ColorLight();
        this.isNetworkOutdated = true;
        this.colorLight = colorLight;
    }
    
    public ColorLight getColorLight() {
        return this.colorLight;
    }
    
    public void setColorLight(final ColorLight colorLight) {
        this.colorLight = colorLight;
        this.isNetworkOutdated = true;
    }
    
    public boolean consumeNetworkOutdated() {
        final boolean temp = this.isNetworkOutdated;
        this.isNetworkOutdated = false;
        return temp;
    }
    
    @Nonnull
    @Override
    public Component<EntityStore> clone() {
        return new DynamicLight(new ColorLight(this.colorLight));
    }
}
