/*
 * Decompiled with CFR 0.152.
 */
package com.evilco.mc.nbt.tag;

import com.evilco.mc.nbt.stream.NbtInputStream;
import com.evilco.mc.nbt.stream.NbtOutputStream;
import com.evilco.mc.nbt.tag.AbstractTag;
import com.evilco.mc.nbt.tag.TagType;
import java.io.IOException;
import javax.annotation.Nonnull;

public class TagFloat
extends AbstractTag {
    protected float value;

    public TagFloat(@Nonnull String name, float value) {
        super(name);
        this.setValue(value);
    }

    public TagFloat(@Nonnull NbtInputStream inputStream, boolean anonymous) throws IOException {
        super(inputStream, anonymous);
        this.setValue(inputStream.readFloat());
    }

    @Override
    public byte getTagID() {
        return TagType.FLOAT.typeID;
    }

    public float getValue() {
        return this.value;
    }

    public void setValue(float f) {
        this.value = f;
    }

    @Override
    public void write(NbtOutputStream outputStream, boolean anonymous) throws IOException {
        super.write(outputStream, anonymous);
        outputStream.writeFloat(this.value);
    }
}
