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

package com.hypixel.hytale.builtin.hytalegenerator.assets.delimiters;

import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.Codec;
import javax.annotation.Nonnull;
import com.hypixel.hytale.builtin.hytalegenerator.delimiters.RangeInt;
import com.hypixel.hytale.assetstore.AssetExtraInfo;
import com.hypixel.hytale.assetstore.codec.AssetBuilderCodec;
import com.hypixel.hytale.assetstore.map.DefaultAssetMap;
import com.hypixel.hytale.assetstore.map.JsonAssetWithMap;

public class RangeIntAsset implements JsonAssetWithMap<String, DefaultAssetMap<String, RangeIntAsset>>
{
    public static final AssetBuilderCodec<String, RangeIntAsset> CODEC;
    private String id;
    private AssetExtraInfo.Data data;
    private int minInclusive;
    private int maxExclusive;
    
    public RangeIntAsset() {
        this.minInclusive = 0;
        this.maxExclusive = 0;
    }
    
    @Nonnull
    public RangeInt build() {
        return new RangeInt(this.minInclusive, this.maxExclusive);
    }
    
    @Nonnull
    @Override
    public String getId() {
        return "";
    }
    
    static {
        CODEC = ((AssetBuilderCodec.Builder)AssetBuilderCodec.builder(RangeIntAsset.class, RangeIntAsset::new, (Codec<String>)Codec.STRING, (asset, id) -> asset.id = id, config -> config.id, (config, data) -> config.data = data, config -> config.data).append(new KeyedCodec<Integer>("MinInclusive", Codec.INTEGER, true), (t, value) -> t.minInclusive = value, t -> t.minInclusive).add().append(new KeyedCodec("MaxExclusive", Codec.INTEGER, true), (t, value) -> t.maxExclusive = value, t -> t.maxExclusive).add()).build();
    }
}
