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

import electrosphere.game.data.foliage.type.FoliageType;
import java.util.List;

/**
 * The map of all types of foliage in the game
 */
public class FoliageTypeMap {
    
    //The list of all foliage types
    List<FoliageType> foliageList;

    /**
     * Gets the list of all foliage types
     * @return The list of all foliage types
     */
    public List<FoliageType> getFoliageList() {
        return foliageList;
    }
    
    /**
     * Gets a foliage type by its name
     * @param name The name of the foliage type
     * @return The type object
     */
    public FoliageType getFoliage(String name){
        for(FoliageType foliage : foliageList){
            if(foliage.getName().matches(name)){
                return foliage;
            }
        }
        return null;
    }
    
}
