package com.alterdekim.game.service;

import com.alterdekim.flash.decompiler.mapper.OutputObjectCallback;
import com.alterdekim.game.entity.Incompatible;
import com.alterdekim.game.repository.IncompatibleRepository;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IncompatibleService implements OutputObjectCallback {

    @Autowired
    private IncompatibleRepository repository;

    @Override
    public void onOutputObjectReady(Object o) {
        this.repository.save((Incompatible) o);
    }

    public List<Incompatible> getAll() {
        return this.repository.findAll();
    }
}
