package macampcorp.macamp.game;

import java.io.Serializable;
import java.util.ArrayList;

public class Inventaire implements Serializable {
    protected ArrayList<Resource>   mAllResources = new ArrayList<Resource>();
    protected ArrayList<Resource>   mDisplayResources = new ArrayList<Resource>();

    public Inventaire()
    {

    }

    public void addResource(Resource r)
    {
        if(mAllResources.contains(r))
            return;

        mAllResources.add(r);
        if(r.isDisplay())
            mDisplayResources.add(r);
    }

    public void addResource(ArrayList<Resource> r)
    {
        for(int i=0; i<r.size(); i++)
            addResource(r.get(i));
    }

    public boolean contains(Resource r)
    {
        return mAllResources.contains(r);
    }

    public Resource get(int i)
    {
        return mAllResources.get(i);
    }

    public int size()
    {
        return getAllResources().size();
    }

    public ArrayList<Resource> getAllResources() {
        return mAllResources;
    }

    public ArrayList<Resource> getDisplayResources() {
        return mDisplayResources;
    }
}
