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

package com.hypixel.hytale.component.metric;

import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import javax.annotation.Nonnull;
import com.hypixel.hytale.codec.Codec;

public class ArchetypeChunkData
{
    @Nonnull
    public static final Codec<ArchetypeChunkData> CODEC;
    @Nonnull
    private String[] componentTypes;
    private int entityCount;
    
    public ArchetypeChunkData() {
        this.componentTypes = new String[0];
    }
    
    public ArchetypeChunkData(@Nonnull final String[] componentTypes, final int entityCount) {
        this.componentTypes = new String[0];
        this.componentTypes = componentTypes;
        this.entityCount = entityCount;
    }
    
    @Nonnull
    public String[] getComponentTypes() {
        return this.componentTypes;
    }
    
    public int getEntityCount() {
        return this.entityCount;
    }
    
    static {
        CODEC = BuilderCodec.builder(ArchetypeChunkData.class, ArchetypeChunkData::new).append(new KeyedCodec<String[]>("ComponentTypes", Codec.STRING_ARRAY), (data, o) -> data.componentTypes = o, data -> data.componentTypes).add().append(new KeyedCodec("EntityCount", Codec.INTEGER), (data, o) -> data.entityCount = o, data -> data.entityCount).add().build();
    }
}
