package electrosphere.game.data.object.type.model;

import electrosphere.game.data.object.type.ObjectData;
import java.util.List;

/**
 * The raw list of object data read from disk
 */
public class ObjectTypeMap {

    //the objects stored in this file
    List<ObjectData> objects;
    //all children files to recursively parse for more object data
    List<String> files;

    /**
     * Gets the list of all objects in this file
     * @return the list
     */
    public List<ObjectData> getObjects() {
        return objects;
    }
    
    /**
     * Gets the object data for an object in this file by its name
     * @param name the name of the object
     * @return The object data
     */
    public ObjectData getObject(String name){
        ObjectData rVal = null;
        for(ObjectData item : objects){
            if(item.getObjectId().equals(name)){
                rVal = item;
                break;
            }
        }
        return rVal;
    }

    /**
     * Gets the list of all children files of this file
     * @return The list of all children files
     */
    public List<String> getFiles(){
        return files;
    }
    
}
