package com.tiedup.remake.entities.kidnapper.hosts;

import com.tiedup.remake.entities.EntityKidnapper;
import com.tiedup.remake.entities.KidnapperJobManager;
import com.tiedup.remake.entities.kidnapper.components.*;
import net.minecraft.network.syncher.EntityDataAccessor;

/**
 * Host implementation for KidnapperDataSerializer callbacks.
 * Provides access to entity data and components for NBT persistence.
 */
public class DataSerializerHost implements IDataSerializerHost {

    private final EntityKidnapper entity;

    public DataSerializerHost(EntityKidnapper entity) {
        this.entity = entity;
    }

    // ENTITY ACCESS

    @Override
    public EntityKidnapper getEntity() {
        return entity;
    }

    // ENTITY DATA ACCESS

    @Override
    public <T> T getEntityData(EntityDataAccessor<T> accessor) {
        return entity.getEntityData().get(accessor);
    }

    @Override
    public <T> void setEntityData(EntityDataAccessor<T> accessor, T value) {
        entity.getEntityData().set(accessor, value);
    }

    // STATE FLAGS

    @Override
    public boolean isGetOutState() {
        return entity.isGetOutState();
    }

    @Override
    public void setGetOutState(boolean state) {
        entity.setGetOutState(state);
    }

    // COMPONENT ACCESS

    @Override
    public KidnapperAppearance getAppearance() {
        return entity.getAppearanceComponent();
    }

    @Override
    public KidnapperAggressionSystem getAggressionSystem() {
        return entity.getAggressionSystem();
    }

    @Override
    public KidnapperCaptiveManager getCaptiveManager() {
        return entity.getCaptiveManagerComponent();
    }

    @Override
    public KidnapperStateManager getStateManager() {
        return entity.getStateManagerComponent();
    }

    @Override
    public KidnapperCampManager getCampManager() {
        return entity.getCampManagerComponent();
    }

    @Override
    public KidnapperJobManager getJobManager() {
        return entity.getJobManager();
    }
}
