Update ref types not to be var in parameters
This commit is contained in:
parent
ae3171cb98
commit
e3216f09d0
3 changed files with 26 additions and 26 deletions
|
|
@ -62,16 +62,16 @@ proc newArray*(pba: PoolByteArray): Array {.inline.} =
|
||||||
new(result, arrayFinalizer)
|
new(result, arrayFinalizer)
|
||||||
initGodotArray(result.godotArray, pba.godotPoolByteArray[])
|
initGodotArray(result.godotArray, pba.godotPoolByteArray[])
|
||||||
|
|
||||||
proc `[]=`*(self: var Array; idx: int; value: Variant) {.inline.} =
|
proc `[]=`*(self: Array; idx: int; value: Variant) {.inline.} =
|
||||||
self.godotArray[idx.cint] = value.godotVariant[]
|
self.godotArray[idx.cint] = value.godotVariant[]
|
||||||
|
|
||||||
proc `[]`*(self: Array; idx: int): Variant {.inline.} =
|
proc `[]`*(self: Array; idx: int): Variant {.inline.} =
|
||||||
newVariant(self.godotArray[idx.cint])
|
newVariant(self.godotArray[idx.cint])
|
||||||
|
|
||||||
proc add*(self: var Array; value: Variant) {.inline.} =
|
proc add*(self: Array; value: Variant) {.inline.} =
|
||||||
self.godotArray.add(value.godotVariant[])
|
self.godotArray.add(value.godotVariant[])
|
||||||
|
|
||||||
proc clear*(self: var Array) {.inline.} =
|
proc clear*(self: Array) {.inline.} =
|
||||||
self.godotArray.clear()
|
self.godotArray.clear()
|
||||||
|
|
||||||
proc count*(self: Array; value: Variant): int {.inline.} =
|
proc count*(self: Array; value: Variant): int {.inline.} =
|
||||||
|
|
@ -80,7 +80,7 @@ proc count*(self: Array; value: Variant): int {.inline.} =
|
||||||
proc isEmpty*(self: Array): bool {.inline.} =
|
proc isEmpty*(self: Array): bool {.inline.} =
|
||||||
self.godotArray.isEmpty()
|
self.godotArray.isEmpty()
|
||||||
|
|
||||||
proc erase*(self: var Array; value: Variant) {.inline.} =
|
proc erase*(self: Array; value: Variant) {.inline.} =
|
||||||
self.godotArray.erase(value.godotVariant[])
|
self.godotArray.erase(value.godotVariant[])
|
||||||
|
|
||||||
proc first*(self: Array): Variant {.inline.} =
|
proc first*(self: Array): Variant {.inline.} =
|
||||||
|
|
@ -101,28 +101,28 @@ proc contains*(self: Array; value: Variant): bool {.inline.} =
|
||||||
proc hash*(self: Array): Hash {.inline.} =
|
proc hash*(self: Array): Hash {.inline.} =
|
||||||
hash(self.godotArray.godotHash())
|
hash(self.godotArray.godotHash())
|
||||||
|
|
||||||
proc insert*(self: var Array; pos: int; value: Variant) {.inline.} =
|
proc insert*(self: Array; pos: int; value: Variant) {.inline.} =
|
||||||
self.godotArray.insert(pos.cint, value.godotVariant[])
|
self.godotArray.insert(pos.cint, value.godotVariant[])
|
||||||
|
|
||||||
proc reverse*(self: var Array) {.inline.} =
|
proc reverse*(self: Array) {.inline.} =
|
||||||
self.godotArray.reverse()
|
self.godotArray.reverse()
|
||||||
|
|
||||||
proc popLast*(self: var Array): Variant {.inline.} =
|
proc popLast*(self: Array): Variant {.inline.} =
|
||||||
newVariant(self.godotArray.popLast())
|
newVariant(self.godotArray.popLast())
|
||||||
|
|
||||||
proc popFirst*(self: var Array): Variant {.inline.} =
|
proc popFirst*(self: Array): Variant {.inline.} =
|
||||||
newVariant(self.godotArray.popFirst())
|
newVariant(self.godotArray.popFirst())
|
||||||
|
|
||||||
proc addLast*(self: var Array; value: Variant) {.inline.} =
|
proc addLast*(self: Array; value: Variant) {.inline.} =
|
||||||
self.godotArray.addLast(value.godotVariant[])
|
self.godotArray.addLast(value.godotVariant[])
|
||||||
|
|
||||||
proc addFirst*(self: var Array; value: Variant) {.inline.} =
|
proc addFirst*(self: Array; value: Variant) {.inline.} =
|
||||||
self.godotArray.addFirst(value.godotVariant[])
|
self.godotArray.addFirst(value.godotVariant[])
|
||||||
|
|
||||||
proc delete*(self: var Array; idx: int) {.inline.} =
|
proc delete*(self: Array; idx: int) {.inline.} =
|
||||||
self.godotArray.delete(idx.cint)
|
self.godotArray.delete(idx.cint)
|
||||||
|
|
||||||
proc setLen*(self: var Array; size: int) {.inline.} =
|
proc setLen*(self: Array; size: int) {.inline.} =
|
||||||
self.godotArray.setLen(size.cint)
|
self.godotArray.setLen(size.cint)
|
||||||
|
|
||||||
proc rfind*(self: Array; what: Variant; fromIdx: int): int {.inline.} =
|
proc rfind*(self: Array; what: Variant; fromIdx: int): int {.inline.} =
|
||||||
|
|
@ -131,7 +131,7 @@ proc rfind*(self: Array; what: Variant; fromIdx: int): int {.inline.} =
|
||||||
proc len*(self: Array): int {.inline.} =
|
proc len*(self: Array): int {.inline.} =
|
||||||
self.godotArray.len.int
|
self.godotArray.len.int
|
||||||
|
|
||||||
proc sort*(self: var Array) {.inline.} =
|
proc sort*(self: Array) {.inline.} =
|
||||||
self.godotArray.sort()
|
self.godotArray.sort()
|
||||||
|
|
||||||
iterator items*(self: Array): Variant =
|
iterator items*(self: Array): Variant =
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ proc len*(self: Dictionary): int {.inline.} =
|
||||||
proc isEmpty*(self: Dictionary): bool {.inline.} =
|
proc isEmpty*(self: Dictionary): bool {.inline.} =
|
||||||
self.godotDictionary.isEmpty()
|
self.godotDictionary.isEmpty()
|
||||||
|
|
||||||
proc clear*(self: var Dictionary) {.inline.} =
|
proc clear*(self: Dictionary) {.inline.} =
|
||||||
self.godotDictionary.clear()
|
self.godotDictionary.clear()
|
||||||
|
|
||||||
import variants, arrays
|
import variants, arrays
|
||||||
|
|
@ -48,7 +48,7 @@ proc contains*(self: Dictionary; key: Variant): bool {.inline.}=
|
||||||
proc contains*(self: Dictionary; keys: Array): bool {.inline.} =
|
proc contains*(self: Dictionary; keys: Array): bool {.inline.} =
|
||||||
self.godotDictionary.contains(keys.godotArray[])
|
self.godotDictionary.contains(keys.godotArray[])
|
||||||
|
|
||||||
proc del*(self: var Dictionary; key: Variant) {.inline.} =
|
proc del*(self: Dictionary; key: Variant) {.inline.} =
|
||||||
self.godotDictionary.del(key.godotVariant[])
|
self.godotDictionary.del(key.godotVariant[])
|
||||||
|
|
||||||
proc hash*(self: Dictionary): Hash {.inline.} =
|
proc hash*(self: Dictionary): Hash {.inline.} =
|
||||||
|
|
@ -71,7 +71,7 @@ proc `[]`*(self: Dictionary; keyStr: string): Variant {.inline.} =
|
||||||
godotStr.deinit()
|
godotStr.deinit()
|
||||||
godotVariant.deinit()
|
godotVariant.deinit()
|
||||||
|
|
||||||
proc `[]=`*(self: var Dictionary; key, value: Variant) {.inline.} =
|
proc `[]=`*(self: Dictionary; key, value: Variant) {.inline.} =
|
||||||
self.godotDictionary[key.godotVariant[]] = value.godotVariant[]
|
self.godotDictionary[key.godotVariant[]] = value.godotVariant[]
|
||||||
|
|
||||||
proc `==`*(self, other: Dictionary): bool {.inline.} =
|
proc `==`*(self, other: Dictionary): bool {.inline.} =
|
||||||
|
|
|
||||||
|
|
@ -33,29 +33,29 @@ template definePoolArray(T, GodotT, DataT, fieldName, newProcName, initProcName;
|
||||||
new(result, poolArrayFinalizer)
|
new(result, poolArrayFinalizer)
|
||||||
initProcName(result.fieldName, arr.godotArray[])
|
initProcName(result.fieldName, arr.godotArray[])
|
||||||
|
|
||||||
proc add*(self: var T; arr: T) {.inline.} =
|
proc add*(self: T; arr: T) {.inline.} =
|
||||||
self.fieldName.add(arr.fieldName)
|
self.fieldName.add(arr.fieldName)
|
||||||
|
|
||||||
proc delete*(self: var T; idx: int) {.inline.} =
|
proc delete*(self: T; idx: int) {.inline.} =
|
||||||
self.fieldName.delete(idx.cint)
|
self.fieldName.delete(idx.cint)
|
||||||
|
|
||||||
proc reverse*(self: var T) {.inline.} =
|
proc reverse*(self: T) {.inline.} =
|
||||||
self.fieldName.reverse()
|
self.fieldName.reverse()
|
||||||
|
|
||||||
proc setLen*(self: var T; size: int) {.inline.} =
|
proc setLen*(self: T; size: int) {.inline.} =
|
||||||
self.fieldName.setLen(size.cint)
|
self.fieldName.setLen(size.cint)
|
||||||
|
|
||||||
proc len*(self: T): int {.inline.} =
|
proc len*(self: T): int {.inline.} =
|
||||||
self.fieldName.len.int
|
self.fieldName.len.int
|
||||||
|
|
||||||
when not noData:
|
when not noData:
|
||||||
proc add*(self: var T; data: DataT) {.inline.} =
|
proc add*(self: T; data: DataT) {.inline.} =
|
||||||
self.fieldName.add(data)
|
self.fieldName.add(data)
|
||||||
|
|
||||||
proc insert*(self: var T; idx: int; data: DataT): Error {.inline.} =
|
proc insert*(self: T; idx: int; data: DataT): Error {.inline.} =
|
||||||
self.fieldName.insert(idx.cint, data)
|
self.fieldName.insert(idx.cint, data)
|
||||||
|
|
||||||
proc `[]=`*(self: var T; idx: int; data: DataT) {.inline.} =
|
proc `[]=`*(self: T; idx: int; data: DataT) {.inline.} =
|
||||||
self.fieldName[idx.cint] = data
|
self.fieldName[idx.cint] = data
|
||||||
|
|
||||||
proc `[]`*(self: T; idx: int): DataT {.inline.} =
|
proc `[]`*(self: T; idx: int): DataT {.inline.} =
|
||||||
|
|
@ -115,17 +115,17 @@ definePoolArray(PoolStringArray, GodotPoolStringArray, string,
|
||||||
godotPoolStringArray, newPoolStringArray,
|
godotPoolStringArray, newPoolStringArray,
|
||||||
initGodotPoolStringArray, true)
|
initGodotPoolStringArray, true)
|
||||||
|
|
||||||
proc add*(self: var PoolStringArray; data: string) =
|
proc add*(self: PoolStringArray; data: string) =
|
||||||
var s = data.toGodotString()
|
var s = data.toGodotString()
|
||||||
self.godotPoolStringArray.add(s)
|
self.godotPoolStringArray.add(s)
|
||||||
s.deinit()
|
s.deinit()
|
||||||
|
|
||||||
proc insert*(self: var PoolStringArray; idx: int; data: string): Error =
|
proc insert*(self: PoolStringArray; idx: int; data: string): Error =
|
||||||
var s = data.toGodotString()
|
var s = data.toGodotString()
|
||||||
result = self.godotPoolStringArray.insert(idx.cint, s)
|
result = self.godotPoolStringArray.insert(idx.cint, s)
|
||||||
s.deinit()
|
s.deinit()
|
||||||
|
|
||||||
proc `[]=`*(self: var PoolStringArray; idx: int; data: string) =
|
proc `[]=`*(self: PoolStringArray; idx: int; data: string) =
|
||||||
var s = data.toGodotString()
|
var s = data.toGodotString()
|
||||||
self.godotPoolStringArray[idx.cint] = s
|
self.godotPoolStringArray[idx.cint] = s
|
||||||
s.deinit()
|
s.deinit()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue