From 0066b81461873f26d9157b7f6d6c570c38a455a0 Mon Sep 17 00:00:00 2001 From: Ramon Gonzalez Fernandez Date: Mon, 22 Mar 2021 00:54:22 -0400 Subject: [PATCH] reformat and squash errors --- build.hxml | 3 +- src/cc/ComputerCraft.hx | 3 +- src/cc/Keys.hx | 236 ++++++++++++++++++++-------------------- src/cc/Multishell.hx | 16 +-- src/cc/OS.hx | 46 ++++---- src/cc/PaintUtils.hx | 14 +-- src/cc/Parallel.hx | 6 +- src/cc/Peripheral.hx | 16 +-- src/cc/Rednet.hx | 34 +++--- src/cc/Redstone.hx | 24 ++-- src/cc/Settings.hx | 16 +-- src/cc/Shell.hx | 30 ++--- src/cc/Term.hx | 72 ++++++------ src/cc/TextUtils.hx | 18 +-- src/cc/Turtle.hx | 108 +++++++++--------- src/cc/Vector.hx | 20 ++-- src/cc/Window.hx | 14 +-- 17 files changed, 338 insertions(+), 338 deletions(-) diff --git a/build.hxml b/build.hxml index 6aff805..5959f62 100644 --- a/build.hxml +++ b/build.hxml @@ -1 +1,2 @@ ---lua main.lua \ No newline at end of file +--lua main.lua +--class-path src \ No newline at end of file diff --git a/src/cc/ComputerCraft.hx b/src/cc/ComputerCraft.hx index c17f65f..a0e31a8 100644 --- a/src/cc/ComputerCraft.hx +++ b/src/cc/ComputerCraft.hx @@ -8,8 +8,7 @@ extern class ComputerCraft { public static function write(text:String):Void; public static function print(text:String):Void; public static function printError(message:String):Void; - public static function read(?replaceChar:String, ?history:Table, ?completeFn:String->Table, ?default: String - ):String; + public static function read(?replaceChar:String, ?history:Table, ?completeFn:String->Table, ?defaultValue:String):String; public static var _HOST:String; public static var _CC_DEFAULT_SETTINGS:String; } diff --git a/src/cc/Keys.hx b/src/cc/Keys.hx index 2a28e55..46f9cf5 100644 --- a/src/cc/Keys.hx +++ b/src/cc/Keys.hx @@ -2,126 +2,126 @@ package cc; @:native("keys") extern class Keys { - public static function getName(code: Int): String; - public static inline function getCode(name: String): Int { + public static function getName(code:Int):String; + public static inline function getCode(name:String):Int { // i know this is bad please don't judge me return (cast Keys)[cast name]; } - public static var a: Int; - public static var c: Int; - public static var b: Int; - public static var e: Int; - public static var pageUp: Int; - public static var g: Int; - public static var f: Int; - public static var i: Int; - public static var h: Int; - public static var k: Int; - public static var j: Int; - public static var space: Int; - public static var l: Int; - public static var o: Int; - public static var n: Int; - public static var q: Int; - public static var f1: Int; - public static var s: Int; + public static var a:Int; + public static var c:Int; + public static var b:Int; + public static var e:Int; + public static var pageUp:Int; + public static var g:Int; + public static var f:Int; + public static var i:Int; + public static var h:Int; + public static var k:Int; + public static var j:Int; + public static var space:Int; + public static var l:Int; + public static var o:Int; + public static var n:Int; + public static var q:Int; + public static var f1:Int; + public static var s:Int; // public static var return: Int; - public static var f5: Int; - public static var seven: Int; - public static var w: Int; - public static var numPadEnter: Int; - public static var y: Int; - public static var x: Int; - public static var numPad6: Int; - public static var z: Int; - public static var backslash: Int; - public static var rightBracket: Int; - public static var f9: Int; - public static var yen: Int; - public static var left: Int; - public static var numPadSubtract: Int; - public static var noconvert: Int; - public static var leftCtrl: Int; - public static var rightCtrl: Int; - public static var numPad2: Int; - public static var insert: Int; - public static var delete: Int; - public static var f4: Int; - public static var grave: Int; - public static var leftAlt: Int; - public static var numPad8: Int; - public static var numLock: Int; - public static var four: Int; - public static var rightAlt: Int; - public static var pause: Int; - public static var numPad0: Int; - public static var numPadEquals: Int; - public static var enter: Int; - public static var down: Int; - public static var eight: Int; - public static var f11: Int; - public static var six: Int; - public static var r: Int; - public static var rightShift: Int; - public static var t: Int; - public static var u: Int; - public static var pageDown: Int; - public static var nine: Int; - public static var zero: Int; - public static var capsLock: Int; - public static var p: Int; - public static var leftBracket: Int; - public static var underscore: Int; - public static var scollLock: Int; - public static var minus: Int; - public static var f14: Int; - public static var m: Int; - public static var cimcumflex: Int; - public static var one: Int; - public static var up: Int; - public static var equals: Int; - public static var d: Int; - public static var f7: Int; - public static var apostrophe: Int; - public static var numPad9: Int; - public static var f15: Int; - public static var stop: Int; - public static var f10: Int; - public static var numPad7: Int; - public static var numPad3: Int; - public static var comma: Int; - public static var numPadAdd: Int; - public static var tab: Int; - public static var numPad4: Int; - public static var f3: Int; - public static var kana: Int; - public static var numPad1: Int; - public static var right: Int; - public static var numPadDecimal: Int; - public static var f2: Int; - public static var leftShift: Int; - public static var backspace: Int; - public static var convert: Int; - public static var end: Int; - public static var three: Int; - public static var kanji: Int; - public static var v: Int; - public static var colon: Int; - public static var semiColon: Int; - public static var two: Int; - public static var f13: Int; - public static var multiply: Int; - public static var period: Int; - public static var ax: Int; - public static var slash: Int; - public static var f6: Int; - public static var at: Int; - public static var numPadDivide: Int; - public static var numPad5: Int; - public static var f12: Int; - public static var f8: Int; - public static var home: Int; - public static var five: Int; - public static var numPadComma: Int; -} \ No newline at end of file + public static var f5:Int; + public static var seven:Int; + public static var w:Int; + public static var numPadEnter:Int; + public static var y:Int; + public static var x:Int; + public static var numPad6:Int; + public static var z:Int; + public static var backslash:Int; + public static var rightBracket:Int; + public static var f9:Int; + public static var yen:Int; + public static var left:Int; + public static var numPadSubtract:Int; + public static var noconvert:Int; + public static var leftCtrl:Int; + public static var rightCtrl:Int; + public static var numPad2:Int; + public static var insert:Int; + public static var delete:Int; + public static var f4:Int; + public static var grave:Int; + public static var leftAlt:Int; + public static var numPad8:Int; + public static var numLock:Int; + public static var four:Int; + public static var rightAlt:Int; + public static var pause:Int; + public static var numPad0:Int; + public static var numPadEquals:Int; + public static var enter:Int; + public static var down:Int; + public static var eight:Int; + public static var f11:Int; + public static var six:Int; + public static var r:Int; + public static var rightShift:Int; + public static var t:Int; + public static var u:Int; + public static var pageDown:Int; + public static var nine:Int; + public static var zero:Int; + public static var capsLock:Int; + public static var p:Int; + public static var leftBracket:Int; + public static var underscore:Int; + public static var scollLock:Int; + public static var minus:Int; + public static var f14:Int; + public static var m:Int; + public static var cimcumflex:Int; + public static var one:Int; + public static var up:Int; + public static var equals:Int; + public static var d:Int; + public static var f7:Int; + public static var apostrophe:Int; + public static var numPad9:Int; + public static var f15:Int; + public static var stop:Int; + public static var f10:Int; + public static var numPad7:Int; + public static var numPad3:Int; + public static var comma:Int; + public static var numPadAdd:Int; + public static var tab:Int; + public static var numPad4:Int; + public static var f3:Int; + public static var kana:Int; + public static var numPad1:Int; + public static var right:Int; + public static var numPadDecimal:Int; + public static var f2:Int; + public static var leftShift:Int; + public static var backspace:Int; + public static var convert:Int; + public static var end:Int; + public static var three:Int; + public static var kanji:Int; + public static var v:Int; + public static var colon:Int; + public static var semiColon:Int; + public static var two:Int; + public static var f13:Int; + public static var multiply:Int; + public static var period:Int; + public static var ax:Int; + public static var slash:Int; + public static var f6:Int; + public static var at:Int; + public static var numPadDivide:Int; + public static var numPad5:Int; + public static var f12:Int; + public static var f8:Int; + public static var home:Int; + public static var five:Int; + public static var numPadComma:Int; +} diff --git a/src/cc/Multishell.hx b/src/cc/Multishell.hx index 2c396f3..67f9b72 100644 --- a/src/cc/Multishell.hx +++ b/src/cc/Multishell.hx @@ -5,11 +5,11 @@ import haxe.extern.Rest; @:native("multishell") extern class Multishell { - public static function getCurrent(): Int; - public static function getCount(): Int; - public static function launch(environment: Table, path: String, args: Rest): Int; - public static function setFocus(id: Int): Void; - public static function setTitle(id: Int, title: String): Void; - public static function getTitle(id: Int): String; - public static function getFocus(): Int; -} \ No newline at end of file + public static function getCurrent():Int; + public static function getCount():Int; + public static function launch(environment:Table, path:String, args:Rest):Int; + public static function setFocus(id:Int):Void; + public static function setTitle(id:Int, title:String):Void; + public static function getTitle(id:Int):String; + public static function getFocus():Int; +} diff --git a/src/cc/OS.hx b/src/cc/OS.hx index ea1f9bb..4dd02ad 100644 --- a/src/cc/OS.hx +++ b/src/cc/OS.hx @@ -6,33 +6,33 @@ import haxe.extern.Rest; @:native("os") extern class OS { - public static function version(): String; - public static function getComputerID(): Int; - public static function getComputerLabel(): String; - public static function setComputerLabel(label: String): Void; - public static function run(environment: Table, path: String, args: Rest): Bool; - public static function loadAPI(path: String): Bool; - public static function unloadAPI(path: String): Void; - public static function queueEvent(type: String, data: Rest): Void; - public static function clock(): Float; - public static function startTimer(timeout: Int): Int; - public static function cancelTimer(id: Int): Void; - public static function time(): Float; - public static function sleep(timeout: Float): Void; - public static function day(): Int; - public static function setAlarm(time: Float): Int; - public static function cancelAlarm(id: Int): Void; - public static function shutdown(): Void; - public static function reboot(): Void; + public static function version():String; + public static function getComputerID():Int; + public static function getComputerLabel():String; + public static function setComputerLabel(label:String):Void; + public static function run(environment:Table, path:String, args:Rest):Bool; + public static function loadAPI(path:String):Bool; + public static function unloadAPI(path:String):Void; + public static function queueEvent(type:String, data:Rest):Void; + public static function clock():Float; + public static function startTimer(timeout:Int):Int; + public static function cancelTimer(id:Int):Void; + public static function time():Float; + public static function sleep(timeout:Float):Void; + public static function day():Int; + public static function setAlarm(time:Float):Int; + public static function cancelAlarm(id:Int):Void; + public static function shutdown():Void; + public static function reboot():Void; - @:native("pullEvent") private static function _pullEvent(?type: String): Dynamic; - @:native("pullEventRaw") private static function _pullEventRaw(?type: String): Dynamic; + @:native("pullEvent") private static function _pullEvent(?type:String):Dynamic; + @:native("pullEventRaw") private static function _pullEventRaw(?type:String):Dynamic; - public static inline function pullEvent(?type: String): Table { + public static inline function pullEvent(?type:String):Table { return cast TableTools.pack(_pullEvent(type)); } - public static inline function pullEventRaw(?type: String): Table { + public static inline function pullEventRaw(?type:String):Table { return cast TableTools.pack(_pullEventRaw(type)); } -} \ No newline at end of file +} diff --git a/src/cc/PaintUtils.hx b/src/cc/PaintUtils.hx index 77d90fe..175f245 100644 --- a/src/cc/PaintUtils.hx +++ b/src/cc/PaintUtils.hx @@ -7,10 +7,10 @@ typedef Image = Table>; @:native("paintutils") extern class PaintUtils { - public static function loadImage(path: String): Image; - public static function drawImage(image: Image, x: Int, y: Int): Void; - public static function drawPixel(x: Int, y: Int, ?color: Color): Void; - public static function drawLine(startX: Int, startY: Int, endX: Int, endY: Int, ?color: Color): Void; - public static function drawBox(startX: Int, startY: Int, endX: Int, endY: Int, ?color: Color): Void; - public static function drawFilledBox(startX: Int, startY: Int, endX: Int, endY: Int, ?color: Color): Void; -} \ No newline at end of file + public static function loadImage(path:String):Image; + public static function drawImage(image:Image, x:Int, y:Int):Void; + public static function drawPixel(x:Int, y:Int, ?color:Color):Void; + public static function drawLine(startX:Int, startY:Int, endX:Int, endY:Int, ?color:Color):Void; + public static function drawBox(startX:Int, startY:Int, endX:Int, endY:Int, ?color:Color):Void; + public static function drawFilledBox(startX:Int, startY:Int, endX:Int, endY:Int, ?color:Color):Void; +} diff --git a/src/cc/Parallel.hx b/src/cc/Parallel.hx index 084c784..4651523 100644 --- a/src/cc/Parallel.hx +++ b/src/cc/Parallel.hx @@ -5,6 +5,6 @@ import haxe.extern.Rest; @:native("parallel") extern class Parallel { - public static function waitForAny(f1: Function, funcs: Rest): Int; - public static function waitForAll(f1: Function, funcs: Rest): Int; -} \ No newline at end of file + public static function waitForAny(f1:Function, funcs:Rest):Int; + public static function waitForAll(f1:Function, funcs:Rest):Int; +} diff --git a/src/cc/Peripheral.hx b/src/cc/Peripheral.hx index 16d329f..53bd24e 100644 --- a/src/cc/Peripheral.hx +++ b/src/cc/Peripheral.hx @@ -6,11 +6,11 @@ import haxe.extern.Rest; @:native("peripheral") extern class Peripheral { - public static function isPresent(name: String): Bool; - public static function getType(name: String): String; - public static function getMethods(name: String): Table; - public static function call(name: String, method: String, args: Rest): T; - public static function wrap(name: String): T; - public static function find(type: String, ?filter: (String, T) -> Bool): Table; - public static function getNames(): Table; -} \ No newline at end of file + public static function isPresent(name:String):Bool; + public static function getType(name:String):String; + public static function getMethods(name:String):Table; + public static function call(name:String, method:String, args:Rest):T; + public static function wrap(name:String):T; + public static function find(type:String, ?filter:(String, T) -> Bool):Table; + public static function getNames():Table; +} diff --git a/src/cc/Rednet.hx b/src/cc/Rednet.hx index ff6a5b7..5d116e0 100644 --- a/src/cc/Rednet.hx +++ b/src/cc/Rednet.hx @@ -6,30 +6,30 @@ import lua.TableTools; typedef MessageData = Dynamic; @:multiReturn -extern class ReceivedMessage { - public var senderID: Int; - public var message: T; - public var distance: Float; - public var protocol: String; +extern class ReceivedMessage { + public var senderID:Int; + public var message:T; + public var distance:Float; + public var protocol:String; } @:native("rednet") extern class Rednet { - public static function open(modem: String): Void; - public static function close(modem: String): Void; - public static function send(to: Int, data: MessageData, ?protocol: String): Void; - public static function broadcast(data: MessageData, ?protocol: String): Void; - public static function receive(?protocol: String, ?timeout: Int): ReceivedMessage; - public static function isOpen(modem: String): Bool; - public static function host(protocol: String, hostname: String): Void; - public static function unhost(protocol: String, hostname: String): Void; + public static function open(modem:String):Void; + public static function close(modem:String):Void; + public static function send(to:Int, data:MessageData, ?protocol:String):Void; + public static function broadcast(data:MessageData, ?protocol:String):Void; + public static function receive(?protocol:String, ?timeout:Int):ReceivedMessage; + public static function isOpen(modem:String):Bool; + public static function host(protocol:String, hostname:String):Void; + public static function unhost(protocol:String, hostname:String):Void; @:native("lookup") - private static function _lookup(protocol: String, ?hostname: String): Dynamic; + private static function _lookup(protocol:String, ?hostname:String):Dynamic; - public static inline function lookup(protocol: String, ?hostname: String): Table { + public static inline function lookup(protocol:String, ?hostname:String):Table { return TableTools.pack(_lookup(protocol, hostname)); } - public static function run(): Void; -} \ No newline at end of file + public static function run():Void; +} diff --git a/src/cc/Redstone.hx b/src/cc/Redstone.hx index e911452..a3f58f2 100644 --- a/src/cc/Redstone.hx +++ b/src/cc/Redstone.hx @@ -5,15 +5,15 @@ import cc.Colors; @:native("redstone") extern class Redstone { - public static function getSides(): Table; - public static function getInput(side: String): Bool; - public static function setOutput(side: String, state: Bool): Void; - public static function getOutput(side: String): Bool; - public static function getAnalogInput(side: String): Int; - public static function setAnalogOutput(side: String, strength: Int): Void; - public static function getAnalogOutput(side: String): Int; - public static function getBundledInput(side: String): Color; - public static function setBundledOutput(side: String, state: Color): Void; - public static function getBundledOutput(side: String): Color; - public static function testBundledInput(side: String, value: Color): Bool; -} \ No newline at end of file + public static function getSides():Table; + public static function getInput(side:String):Bool; + public static function setOutput(side:String, state:Bool):Void; + public static function getOutput(side:String):Bool; + public static function getAnalogInput(side:String):Int; + public static function setAnalogOutput(side:String, strength:Int):Void; + public static function getAnalogOutput(side:String):Int; + public static function getBundledInput(side:String):Color; + public static function setBundledOutput(side:String, state:Color):Void; + public static function getBundledOutput(side:String):Color; + public static function testBundledInput(side:String, value:Color):Bool; +} diff --git a/src/cc/Settings.hx b/src/cc/Settings.hx index 9180b70..c4cecf7 100644 --- a/src/cc/Settings.hx +++ b/src/cc/Settings.hx @@ -6,11 +6,11 @@ typedef SettingData = Dynamic; @:native("settings") extern class Settings { - public static function set(name: String, value: SettingData): Void; - public static function get(name: String, ?defaultValue: SettingData): SettingData; - public static function unset(name: String): Void; - public static function clear(): Void; - public static function getNames(): Table; - public static function load(path: String): Bool; - public static function save(path: String): Bool; -} \ No newline at end of file + public static function set(name:String, value:SettingData):Void; + public static function get(name:String, ?defaultValue:SettingData):SettingData; + public static function unset(name:String):Void; + public static function clear():Void; + public static function getNames():Table; + public static function load(path:String):Bool; + public static function save(path:String):Bool; +} diff --git a/src/cc/Shell.hx b/src/cc/Shell.hx index 57173ea..76010f8 100644 --- a/src/cc/Shell.hx +++ b/src/cc/Shell.hx @@ -5,20 +5,20 @@ import haxe.extern.Rest; @:native("shell") extern class Shell { - public static function exit(): Void; - public static function dir(): String; - public static function setDir(path: String): Void; - public static function path(): String; - public static function setPath(path: String): Void; - public static function resolve(localPath: String): String; - public static function resolveProgram(name: String): String; - public static function aliases(): Table; - public static function setAlias(alias: String, program: String): Void; - public static function clearAlias(alias: String): Void; - public static function programs(?showHidden: Bool): Table; - public static function getRunningProgram(): String; - public static function run(command: String, args: Rest): Bool; - public static function openTab(command: String, args: Rest): Int; - public static function switchTab(tabID: Int): Void; + public static function exit():Void; + public static function dir():String; + public static function setDir(path:String):Void; + public static function path():String; + public static function setPath(path:String):Void; + public static function resolve(localPath:String):String; + public static function resolveProgram(name:String):String; + public static function aliases():Table; + public static function setAlias(alias:String, program:String):Void; + public static function clearAlias(alias:String):Void; + public static function programs(?showHidden:Bool):Table; + public static function getRunningProgram():String; + public static function run(command:String, args:Rest):Bool; + public static function openTab(command:String, args:Rest):Int; + public static function switchTab(tabID:Int):Void; // todo: completion functions } diff --git a/src/cc/Term.hx b/src/cc/Term.hx index 7a0d417..d607f70 100644 --- a/src/cc/Term.hx +++ b/src/cc/Term.hx @@ -4,52 +4,52 @@ import cc.Colors; @:multiReturn extern class TerminalPosition { - public var x: Int; - public var y: Int; + public var x:Int; + public var y:Int; } @:multiReturn extern class TerminalSize { - public var width: Int; - public var height: Int; + public var width:Int; + public var height:Int; } @:luaDotMethod extern class TerminalObject { - public function write(text: String): Void; - public function blit(text: String, colors: String, background: String): Void; - public function clear(): Void; - public function clearLine(): Void; - public function getCursorPos(): TerminalPosition; - public function setCursorPos(x: Int, y: Int): Void; - public function setCursorBlink(value: Bool): Void; - public function isColor(): Bool; - public function getSize(): TerminalSize; - public function scroll(lines: Int): Void; - public function setTextColor(color: Color): Void; - public function getTextColor(): Color; - public function setBackgroundColor(color: Color): Void; - public function getBackgroundColor(): Color; + public function write(text:String):Void; + public function blit(text:String, colors:String, background:String):Void; + public function clear():Void; + public function clearLine():Void; + public function getCursorPos():TerminalPosition; + public function setCursorPos(x:Int, y:Int):Void; + public function setCursorBlink(value:Bool):Void; + public function isColor():Bool; + public function getSize():TerminalSize; + public function scroll(lines:Int):Void; + public function setTextColor(color:Color):Void; + public function getTextColor():Color; + public function setBackgroundColor(color:Color):Void; + public function getBackgroundColor():Color; } @:native("term") extern class Term { - public static function write(text: String): Void; - public static function blit(text: String, colors: String, background: String): Void; - public static function clear(): Void; - public static function clearLine(): Void; - public static function getCursorPos(): TerminalPosition; - public static function setCursorPos(x: Int, y: Int): Void; - public static function setCursorBlink(value: Bool): Void; - public static function isColor(): Bool; - public static function getSize(): TerminalSize; - public static function scroll(lines: Int): Void; - public static function setTextColor(color: Color): Void; - public static function getTextColor(): Color; - public static function setBackgroundColor(color: Color): Void; - public static function getBackgroundColor(): Color; + public static function write(text:String):Void; + public static function blit(text:String, colors:String, background:String):Void; + public static function clear():Void; + public static function clearLine():Void; + public static function getCursorPos():TerminalPosition; + public static function setCursorPos(x:Int, y:Int):Void; + public static function setCursorBlink(value:Bool):Void; + public static function isColor():Bool; + public static function getSize():TerminalSize; + public static function scroll(lines:Int):Void; + public static function setTextColor(color:Color):Void; + public static function getTextColor():Color; + public static function setBackgroundColor(color:Color):Void; + public static function getBackgroundColor():Color; - public static function redirect(target: TerminalObject): TerminalObject; - public static function current(): TerminalObject; - public static function native(): TerminalObject; -} \ No newline at end of file + public static function redirect(target:TerminalObject):TerminalObject; + public static function current():TerminalObject; + public static function native():TerminalObject; +} diff --git a/src/cc/TextUtils.hx b/src/cc/TextUtils.hx index adb9cf6..74846ad 100644 --- a/src/cc/TextUtils.hx +++ b/src/cc/TextUtils.hx @@ -4,14 +4,14 @@ typedef TextUtilsSerializable = Dynamic; @:native("textutils") extern class TextUtils { - public static function slowWrite(text: String, ?rate: Float): Void; - public static function slowPrint(text: String, ?rate: Float): Void; - public static function formatTime(time: Float, ?twentyFourHour: Bool): String; + public static function slowWrite(text:String, ?rate:Float):Void; + public static function slowPrint(text:String, ?rate:Float):Void; + public static function formatTime(time:Float, ?twentyFourHour:Bool):String; // todo: tabulate, paged tabulate - public static function pagedPrint(text: String, freeLines: Int): Int; - public static function serialize(data: TextUtilsSerializable): String; - public static function unserialize(from: String): T; - public static function serializeJSON(data: TextUtilsSerializable, ?unquoteKeys: Bool): String; - public static function urlEncode(data: String): String; + public static function pagedPrint(text:String, freeLines:Int):Int; + public static function serialize(data:TextUtilsSerializable):String; + public static function unserialize(from:String):T; + public static function serializeJSON(data:TextUtilsSerializable, ?unquoteKeys:Bool):String; + public static function urlEncode(data:String):String; // todo: complete -} \ No newline at end of file +} diff --git a/src/cc/Turtle.hx b/src/cc/Turtle.hx index 28ad3ae..0f86ed0 100644 --- a/src/cc/Turtle.hx +++ b/src/cc/Turtle.hx @@ -4,71 +4,71 @@ import haxe.extern.EitherType; @:multiReturn extern class TurtleActionResult { - public var successful: Bool; - public var error: String; + public var successful:Bool; + public var error:String; } extern class TurtleItemDetail { - public var name: String; - public var damage: Int; - public var count: Int; + public var name:String; + public var damage:Int; + public var count:Int; } extern class TurtleBlockDetail { - public var name: String; - public var metadata: Int; - public var state: Dynamic; + public var name:String; + public var metadata:Int; + public var state:Dynamic; } @:multiReturn extern class TurtleInspectResult { - public var successful: Bool; - public var result: EitherType; + public var successful:Bool; + public var result:EitherType; } @:native("turtle") extern class Turtle { - public static function craft(qty: Int): TurtleActionResult; - public static function forward(): TurtleActionResult; - public static function back(): TurtleActionResult; - public static function up(): TurtleActionResult; - public static function down(): TurtleActionResult; - public static function turnLeft(): TurtleActionResult; - public static function turnRight(): TurtleActionResult; - public static function select(slot: Int): Bool; - public static function getSelectedSlot(): Int; - public static function getItemCount(?slot: Int): Int; - public static function getItemSpace(?slot: Int): Int; - public static function getItemDetail(?slot: Int): TurtleItemDetail; - public static function equipLeft(): TurtleActionResult; - public static function equipRight(): TurtleActionResult; - public static function attack(): TurtleActionResult; - public static function attackUp(): TurtleActionResult; - public static function attackDown(): TurtleActionResult; - public static function dig(): TurtleActionResult; - public static function digUp(): TurtleActionResult; - public static function digDown(): TurtleActionResult; - public static function place(?signText: String): TurtleActionResult; - public static function placeUp(): TurtleActionResult; - public static function placeDown(): TurtleActionResult; - public static function detect(): Bool; - public static function detectUp(): Bool; - public static function detectDown(): Bool; - public static function inspect(): TurtleInspectResult; - public static function inspectUp(): TurtleInspectResult; - public static function inspectDown(): TurtleInspectResult; - public static function compare(): Bool; - public static function compareUp(): Bool; - public static function compareDown(): Bool; - public static function compareTo(slot: Int): Bool; - public static function drop(?count: Int): TurtleActionResult; - public static function dropUp(?count: Int): TurtleActionResult; - public static function dropDown(?count: Int): TurtleActionResult; - public static function suck(?amount: Int): TurtleActionResult; - public static function suckUp(?amount: Int): TurtleActionResult; - public static function suckDown(?amount: Int): TurtleActionResult; - public static function refuel(?qty: Int): TurtleActionResult; - public static function getFuelLevel(): Int; - public static function getFuelLimit(): Int; - public static function transferTo(to: Int, ?qty: Int): Bool; -} \ No newline at end of file + public static function craft(qty:Int):TurtleActionResult; + public static function forward():TurtleActionResult; + public static function back():TurtleActionResult; + public static function up():TurtleActionResult; + public static function down():TurtleActionResult; + public static function turnLeft():TurtleActionResult; + public static function turnRight():TurtleActionResult; + public static function select(slot:Int):Bool; + public static function getSelectedSlot():Int; + public static function getItemCount(?slot:Int):Int; + public static function getItemSpace(?slot:Int):Int; + public static function getItemDetail(?slot:Int):TurtleItemDetail; + public static function equipLeft():TurtleActionResult; + public static function equipRight():TurtleActionResult; + public static function attack():TurtleActionResult; + public static function attackUp():TurtleActionResult; + public static function attackDown():TurtleActionResult; + public static function dig():TurtleActionResult; + public static function digUp():TurtleActionResult; + public static function digDown():TurtleActionResult; + public static function place(?signText:String):TurtleActionResult; + public static function placeUp():TurtleActionResult; + public static function placeDown():TurtleActionResult; + public static function detect():Bool; + public static function detectUp():Bool; + public static function detectDown():Bool; + public static function inspect():TurtleInspectResult; + public static function inspectUp():TurtleInspectResult; + public static function inspectDown():TurtleInspectResult; + public static function compare():Bool; + public static function compareUp():Bool; + public static function compareDown():Bool; + public static function compareTo(slot:Int):Bool; + public static function drop(?count:Int):TurtleActionResult; + public static function dropUp(?count:Int):TurtleActionResult; + public static function dropDown(?count:Int):TurtleActionResult; + public static function suck(?amount:Int):TurtleActionResult; + public static function suckUp(?amount:Int):TurtleActionResult; + public static function suckDown(?amount:Int):TurtleActionResult; + public static function refuel(?qty:Int):TurtleActionResult; + public static function getFuelLevel():Int; + public static function getFuelLimit():Int; + public static function transferTo(to:Int, ?qty:Int):Bool; +} diff --git a/src/cc/Vector.hx b/src/cc/Vector.hx index 42641aa..a7f2d6c 100644 --- a/src/cc/Vector.hx +++ b/src/cc/Vector.hx @@ -2,15 +2,15 @@ package cc; @:native("vector") extern class Vector { - @:native("new") public static function create(x: Int, y: Int, z: Int): Vector; + @:native("new") public static function create(x:Int, y:Int, z:Int):Vector; - public function add(other: Vector): Vector; - public function sub(other: Vector): Vector; - public function mul(n: Float): Vector; - public function dot(other: Vector): Float; - public function cross(other: Vector): Float; - public function length(): Float; - public function normalize(): Vector; - public function round(): Vector; - @:native("tostring") public function toString(): String; + public function add(other:Vector):Vector; + public function sub(other:Vector):Vector; + public function mul(n:Float):Vector; + public function dot(other:Vector):Float; + public function cross(other:Vector):Float; + public function length():Float; + public function normalize():Vector; + public function round():Vector; + @:native("tostring") public function toString():String; } diff --git a/src/cc/Window.hx b/src/cc/Window.hx index fa517c6..f682792 100644 --- a/src/cc/Window.hx +++ b/src/cc/Window.hx @@ -5,11 +5,11 @@ import cc.Term; @:native("window") @:luaDotMethod extern class Window extends TerminalObject { - public static function create(parent: TerminalObject, x: Int, y: Int, width: Int, height: Int, ?visible: Bool): Window; + public static function create(parent:TerminalObject, x:Int, y:Int, width:Int, height:Int, ?visible:Bool):Window; - public function setVisible(visible: Bool): Void; - public function redraw(): Void; - public function restoreCursor(): Void; - public function getPosition(): TerminalPosition; - public function reposition(x: Int, y: Int, ?width: Int, ?height: Int): Void; -} \ No newline at end of file + public function setVisible(visible:Bool):Void; + public function redraw():Void; + public function restoreCursor():Void; + public function getPosition():TerminalPosition; + public function reposition(x:Int, y:Int, ?width:Int, ?height:Int):Void; +}