Search in sources :

Example 1 with IVariableWidget

use of pneumaticCraft.common.progwidgets.IVariableWidget in project PneumaticCraft by MineMaarten.

the class DroneAIManager method setWidgets.

public void setWidgets(List<IProgWidget> progWidgets) {
    this.progWidgets = progWidgets;
    for (IProgWidget widget : progWidgets) {
        if (widget instanceof IVariableWidget) {
            ((IVariableWidget) widget).setAIManager(this);
        }
    }
    gotoFirstWidget();
}
Also used : IVariableWidget(pneumaticCraft.common.progwidgets.IVariableWidget) IProgWidget(pneumaticCraft.common.progwidgets.IProgWidget)

Example 2 with IVariableWidget

use of pneumaticCraft.common.progwidgets.IVariableWidget in project PneumaticCraft by MineMaarten.

the class TileEntityProgrammer method getAllVariables.

/**
     * Returns a set with all variables that are used in the program.
     * @return
     */
public Set<String> getAllVariables() {
    Set<String> variables = new HashSet<String>();
    for (IProgWidget widget : progWidgets) {
        if (widget instanceof IVariableWidget)
            ((IVariableWidget) widget).addVariables(variables);
    }
    variables.remove("");
    return variables;
}
Also used : IVariableWidget(pneumaticCraft.common.progwidgets.IVariableWidget) IProgWidget(pneumaticCraft.common.progwidgets.IProgWidget) HashSet(java.util.HashSet)

Aggregations

IProgWidget (pneumaticCraft.common.progwidgets.IProgWidget)2 IVariableWidget (pneumaticCraft.common.progwidgets.IVariableWidget)2 HashSet (java.util.HashSet)1