electrodynamics/electrical/src/main/scala/resonantinduction/electrical/encoder/coding/IProgram.java

62 lines
1.9 KiB
Java
Raw Normal View History

2014-01-11 06:59:55 +01:00
package resonantinduction.electrical.encoder.coding;
import java.util.HashMap;
import net.minecraft.nbt.NBTTagCompound;
import universalelectricity.api.vector.Vector2;
2014-01-08 15:18:24 +01:00
/**
* Flow chart style program. Each command in the program needs to have a stored location so it can
* be saved and loaded with its correct connections. Though the location only need to be a simple
* Column and row based system.
*
2014-01-08 15:18:24 +01:00
* @author DarkGuardsman
*/
public interface IProgram extends Cloneable
{
2014-01-08 15:18:24 +01:00
/** Called when the program is added to an encoder, machine, or devices. */
public void init(IProgrammableMachine machine);
2014-01-08 15:18:24 +01:00
public IProgrammableMachine getMachine();
2014-01-08 15:18:24 +01:00
/**
* Variables this program has to operate. Is still limited by the actual machine. String is the
* name, Object is the starting value and data type
*/
public HashMap<String, Object> getDeclairedVarables();
2014-01-08 15:18:24 +01:00
/** Next task in the set. Its up to the program to increment down the list */
public ITask getNextTask();
2014-01-08 15:18:24 +01:00
/** Gets a task at the given x y location in the program */
public ITask getTaskAt(int col, int row);
2014-01-08 15:18:24 +01:00
/** Returns the entire program as a map as grid locations and tasks. */
public HashMap<Vector2, ITask> getTaskMap();
2014-01-08 15:18:24 +01:00
/**
* Sets the task at the point overriding what was there. If the task is null remove it and shift
* everything up one
*/
public void setTaskAt(int col, int row, ITask task);
2014-01-08 15:18:24 +01:00
/** Inserts a task at the point. If a task is already there everything should shift down 1 */
public void insertTask(int col, int row, ITask task);
2014-01-08 15:18:24 +01:00
/** Return this program to its starting conditions */
public void reset();
2014-01-08 15:18:24 +01:00
/** Sets the declared variable */
public void setVar(String name, Object object);
2014-01-08 15:18:24 +01:00
/** Gets a declared variable */
public Object getVar(String name);
2014-01-08 15:18:24 +01:00
/** return size in commands high and wide */
public Vector2 getSize();
2014-01-08 15:18:24 +01:00
public NBTTagCompound save(NBTTagCompound nbt);
2014-01-08 15:18:24 +01:00
public void load(NBTTagCompound nbt);
}