-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added initial *generated* documentation
* removed harmful setActive
- Loading branch information
Radu Andries
committed
Aug 29, 2017
1 parent
8eb0d84
commit 308e24d
Showing
5 changed files
with
224 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
# TileEntityKineticGenerator | ||
|
||
## get_kinetic_production | ||
|
||
# TileEntitySteamKineticGenerator | ||
|
||
## get_steam_info | ||
|
||
## get_water_info | ||
|
||
## get_output | ||
|
||
## get_turbine_damage | ||
|
||
# TileEntityLiquidHeatExchanger | ||
|
||
## get_input_tank | ||
|
||
## get_output_tank | ||
|
||
# TileEntityHeatSourceInventory | ||
|
||
## get_heat | ||
|
||
# TileEntitySteamGenerator | ||
|
||
## get_pressure | ||
|
||
## set_pressure | ||
|
||
## get_water_input | ||
|
||
## set_water_input | ||
|
||
## get_calcification | ||
|
||
## get_heat_input | ||
|
||
## get_system_heat | ||
|
||
## get_output_info | ||
|
||
## get_water_info | ||
|
||
# TileEntityStirlingGenerator | ||
|
||
## get_production | ||
|
||
# TileEntityElectricBlock | ||
|
||
## get_energy | ||
|
||
## get_capacity | ||
|
||
## get_output | ||
|
||
# TileEntityElectricMachine | ||
|
||
## get_energy_info | ||
|
||
# TileEntityNuclearReactorElectric | ||
|
||
## get_eu_output | ||
|
||
## get_heat | ||
|
||
## get_emit_heat | ||
|
||
## get_hot_fluid | ||
|
||
## get_cold_fluid | ||
|
||
# TileEntityCondenser | ||
This tile entity is used by the condenser | ||
## get_progress | ||
Gets the progress of the operation. | ||
|
||
Returns: *(int, int)* - current progress over maximum progress | ||
## get_input_tank | ||
Gets information about the input tank | ||
## get_output_tank | ||
Gets information about the output tank | ||
# TileEntityBlock | ||
|
||
## is_active | ||
|
||
# TileEntityLiquidTankElectricMachine | ||
|
||
## get_fluid_info | ||
|
||
# TileEntityFluidRegulator | ||
|
||
## get_output_rate | ||
|
||
## set_output_rate | ||
|
||
## get_mode | ||
|
||
## set_mode | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package it.antani; | ||
|
||
import com.sun.javadoc.*; | ||
import com.sun.tools.javadoc.ClassDocImpl; | ||
|
||
import java.io.BufferedWriter; | ||
import java.io.File; | ||
import java.io.IOException; | ||
import java.lang.reflect.Method; | ||
import java.nio.file.Files; | ||
import java.nio.file.Paths; | ||
|
||
public class LuaDocumenter { | ||
public static boolean start(RootDoc root) { | ||
|
||
try { | ||
ClassDoc[] classes = root.classes(); | ||
BufferedWriter writer = Files.newBufferedWriter(Paths.get(getPath(root.options()))); | ||
for(ClassDoc clazz : classes){ | ||
for(AnnotationDesc ann : clazz.annotations()){ | ||
if(ann.annotationType().toString().equals("it.antani.cc.annotations.AcceptsTileEntity")){ | ||
writeClass(writer, clazz, ann); | ||
} | ||
} | ||
} | ||
writer.flush(); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
private static String getPath(String[][] options){ | ||
for(String[] opt: options){ | ||
if(opt[0].equals("-d")){ | ||
return opt[1] + File.separator + "luaDoc.md"; | ||
} | ||
} | ||
throw new RuntimeException("No -d param was provided"); | ||
} | ||
|
||
public static int optionLength(String option) { | ||
if(option.equals("-d")) { | ||
return 2; | ||
} | ||
return 0; | ||
} | ||
|
||
public static boolean validOptions(String options[][], | ||
DocErrorReporter reporter) { | ||
return true; | ||
} | ||
|
||
|
||
private static void writeClass(BufferedWriter writer, ClassDoc clazz, AnnotationDesc ann) throws IOException{ | ||
String tileEntity = ((ClassDocImpl)ann.elementValues()[0].value().value()).asClassDoc().name(); | ||
writer.write("# " + tileEntity); | ||
writer.newLine(); | ||
writer.write(clazz.commentText()); | ||
writer.newLine(); | ||
for (MethodDoc m : clazz.methods()){ | ||
boolean lua = false; | ||
String method = ""; | ||
for(AnnotationDesc mann : m.annotations()){ | ||
if(mann.annotationType().toString().equals("it.antani.cc.annotations.LuaMethod")){ | ||
lua = true; | ||
method = mann.elementValues()[0].value().value().toString(); | ||
break; | ||
} | ||
} | ||
if(lua){ | ||
writer.write("## " + method); | ||
writer.newLine(); | ||
writer.write(m.commentText()); | ||
writer.newLine(); | ||
} | ||
} | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters