package ObjEditingNatives import NoWurst import Boolean import Annotations public interface StringLevelClosure function run(int lvl) returns string public interface IntLevelClosure function run(int lvl) returns int public interface RealLevelClosure function run(int lvl) returns real public interface BooleanLevelClosure function run(int lvl) returns boolean public tuple ObjectDefinition(string key) // creates a new unit objectdefinition // for example to create a new unit with id "h000" which is based on a footman ("hfoo") // let u = createObjectDefinition("w3u", "h000", "hfoo") @compiletimenative public function createObjectDefinition(string fileType, int newId, int deriveFrom) returns ObjectDefinition return ObjectDefinition("") // dummy implementation // changes an int value of an objectdefinition @compiletimenative public function ObjectDefinition.setInt(string modification, int value) public function ObjectDefinition.setBoolean(string modification, boolean value) this.setInt(modification, value.toInt()) // changes a string value of an objectdefinition @compiletimenative public function ObjectDefinition.setString(string modification, string value) // changes a real of an objectdefinition @compiletimenative public function ObjectDefinition.setReal(string modification, real value) // changes a unreal (real between 0.0 and 1.0) of an objectdefinition @compiletimenative public function ObjectDefinition.setUnreal(string modification, real value) // changes an int value of an objectdefinition @compiletimenative public function ObjectDefinition.setLvlInt(string modification, int lvl, int value) // changes a string value of an objectdefinition @compiletimenative public function ObjectDefinition.setLvlString(string modification, int lvl, string value) // changes a real of an objectdefinition @compiletimenative public function ObjectDefinition.setLvlReal(string modification, int lvl, real value) // changes a unreal (real between 0.0 and 1.0) of an objectdefinition @compiletimenative public function ObjectDefinition.setLvlUnreal(string modification, int lvl, real value) // changes an int value of an objectdefinition @compiletimenative public function ObjectDefinition.setLvlDataInt(string modification, int lvl, int dataPointer, int value) // changes a string value of an objectdefinition @compiletimenative public function ObjectDefinition.setLvlDataString(string modification, int lvl, int dataPointer, string value) // changes a real of an objectdefinition @compiletimenative public function ObjectDefinition.setLvlDataReal(string modification, int lvl, int dataPointer, real value) // changes a unreal (real between 0.0 and 1.0) of an objectdefinition @compiletimenative public function ObjectDefinition.setLvlDataUnreal(string modification, int lvl, int dataPointer, real value) public function ObjectDefinition.setLvlDataBoolean(string modification, int lvl, int dataPointer, boolean value) if value this.setLvlDataInt(modification, lvl, dataPointer, 1) else this.setLvlDataInt(modification, lvl, dataPointer, 0) public function ObjectDefinition.setLevelsDataString(string modification, int maxLevel, int dataPointer, StringLevelClosure lc) for i = 1 to maxLevel this.setLvlDataString(modification, i, dataPointer, lc.run(i)) public function ObjectDefinition.setLevelsDataInt(string modification, int maxLevel, int dataPointer, IntLevelClosure lc) for i = 1 to maxLevel this.setLvlDataInt(modification, i, dataPointer, lc.run(i)) public function ObjectDefinition.setLevelsDataUnreal(string modification, int maxLevel, int dataPointer, RealLevelClosure lc) for i = 1 to maxLevel this.setLvlDataUnreal(modification, i, dataPointer, lc.run(i)) public function ObjectDefinition.setLevelsDataReal(string modification, int maxLevel, int dataPointer, RealLevelClosure lc) for i = 1 to maxLevel this.setLvlDataReal(modification, i, dataPointer, lc.run(i)) public function ObjectDefinition.setLevelsDataBoolean(string modification, int maxLevel, int dataPointer, BooleanLevelClosure lc) for i = 1 to maxLevel this.setLvlDataBoolean(modification, i, dataPointer, lc.run(i))