- Added documentation to some classes

- Created script provider system
- Did some refactoring to improve the API
This commit is contained in:
Stan Hebben committed 2014-06-10 21:12:55 +02:00
1 parent 38b78ce305
commit 97c7f42400
50 files changed
+1311 -318

No files matched your search

@@ -0,0 +1,52 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package minetweaker.runtime.providers;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import minetweaker.runtime.IScriptIterator;
/**
*
* @author Stan
*/
public class ScriptIteratorSingle implements IScriptIterator {
private final File file;
private boolean first = true;
public ScriptIteratorSingle(File file) {
this.file = file;
}
@Override
public String getGroupName() {
return file.getName();
}
@Override
public boolean next() {
if (first) {
first = false;
return true;
} else {
return false;
}
}
@Override
public String getName() {
return file.getName();
}
@Override
public InputStream open() throws IOException {
return new BufferedInputStream(new FileInputStream(file));
}
}