|
| 1 | +-- Generated by TypescriptToLua v0.6.0 |
| 2 | +-- https://github.com/Perryvw/TypescriptToLua |
| 3 | + |
| 4 | +-- Generated by TypescriptToLua v0.6.0 |
| 5 | +-- https://github.com/Perryvw/TypescriptToLua |
| 6 | + |
| 7 | +-- Generated by TypescriptToLua v0.6.0 |
| 8 | +-- https://github.com/Perryvw/TypescriptToLua |
| 9 | +function ___TS__ArrayForEach(arr,callbackFn,thisArg) |
| 10 | + local i = 0 |
| 11 | + while(i<#arr) do |
| 12 | + do |
| 13 | + callbackFn(arr[i+1],i,arr) |
| 14 | + end |
| 15 | + ::__continue0:: |
| 16 | + i=i+1 |
| 17 | + end |
| 18 | +end |
| 19 | + |
| 20 | +-- Generated by TypescriptToLua v0.6.0 |
| 21 | +-- https://github.com/Perryvw/TypescriptToLua |
| 22 | + |
| 23 | +-- Generated by TypescriptToLua v0.6.0 |
| 24 | +-- https://github.com/Perryvw/TypescriptToLua |
| 25 | +function ___TS__ArrayMap(arr,callbackfn,thisArg) |
| 26 | + local newArray = {} |
| 27 | + |
| 28 | + local i = 0 |
| 29 | + while(i<#arr) do |
| 30 | + do |
| 31 | + newArray[i+1] = callbackfn(arr[i+1],i,arr) |
| 32 | + end |
| 33 | + ::__continue0:: |
| 34 | + i=i+1 |
| 35 | + end |
| 36 | + return newArray |
| 37 | +end |
| 38 | + |
| 39 | +-- Generated by TypescriptToLua v0.6.0 |
| 40 | +-- https://github.com/Perryvw/TypescriptToLua |
| 41 | +function ___TS__ArrayPush(arr,...) |
| 42 | + local items = { ... } |
| 43 | + for _, item in ipairs(items) do |
| 44 | + do |
| 45 | + arr[#arr+1] = item |
| 46 | + end |
| 47 | + ::__continue0:: |
| 48 | + end |
| 49 | +end |
| 50 | + |
| 51 | +-- Generated by TypescriptToLua v0.6.0 |
| 52 | +-- https://github.com/Perryvw/TypescriptToLua |
| 53 | + |
| 54 | +-- Generated by TypescriptToLua v0.6.0 |
| 55 | +-- https://github.com/Perryvw/TypescriptToLua |
| 56 | + |
| 57 | +-- Generated by TypescriptToLua v0.6.0 |
| 58 | +-- https://github.com/Perryvw/TypescriptToLua |
| 59 | + |
| 60 | +-- Generated by TypescriptToLua v0.6.0 |
| 61 | +-- https://github.com/Perryvw/TypescriptToLua |
| 62 | +function ___TS__InstanceOf(obj,classTbl) |
| 63 | + while obj~=nil do |
| 64 | + do |
| 65 | + if obj.__index==classTbl then |
| 66 | + return true |
| 67 | + end |
| 68 | + obj = obj.__base |
| 69 | + end |
| 70 | + ::__continue0:: |
| 71 | + end |
| 72 | + return false |
| 73 | +end |
| 74 | + |
| 75 | +-- Generated by TypescriptToLua v0.6.0 |
| 76 | +-- https://github.com/Perryvw/TypescriptToLua |
| 77 | +Map = Map or {} |
| 78 | +Map.__index = Map |
| 79 | +function Map.new(construct, ...) |
| 80 | + local instance = setmetatable({}, Map) |
| 81 | + if construct and Map.constructor then Map.constructor(instance, ...) end |
| 82 | + return instance |
| 83 | +end |
| 84 | +function Map.constructor(self) |
| 85 | +end |
| 86 | +function Map.Map(self,other) |
| 87 | + self.items = {} |
| 88 | + self.size = 0 |
| 89 | + if other then |
| 90 | + self.size = other.size |
| 91 | + other:forEach(function(value,key) |
| 92 | + self.items[key] = value |
| 93 | + end |
| 94 | +) |
| 95 | + end |
| 96 | +end |
| 97 | +function Map.clear(self) |
| 98 | + self.items = {} |
| 99 | + self.size = 0 |
| 100 | +end |
| 101 | +function Map.delete(self,key) |
| 102 | + local contains = self:has(key) |
| 103 | + |
| 104 | + self.items[key] = nil |
| 105 | + self.size = (self.size-1) |
| 106 | + return contains |
| 107 | +end |
| 108 | +function Map.entries(self) |
| 109 | + local out = {} |
| 110 | + |
| 111 | + for key, _ in pairs(self.items) do |
| 112 | + do |
| 113 | + out[#out+1+1] = {key,self.items[key]} |
| 114 | + end |
| 115 | + ::__continue0:: |
| 116 | + end |
| 117 | + return out |
| 118 | +end |
| 119 | +function Map.forEach(self,callback) |
| 120 | + for key, _ in pairs(self.items) do |
| 121 | + do |
| 122 | + callback(self.items[key],key,self) |
| 123 | + end |
| 124 | + ::__continue1:: |
| 125 | + end |
| 126 | +end |
| 127 | +function Map.get(self,key) |
| 128 | + return self.items[key] |
| 129 | +end |
| 130 | +function Map.has(self,key) |
| 131 | + return self.items[key]~=nil |
| 132 | +end |
| 133 | +function Map.keys(self) |
| 134 | + local out = {} |
| 135 | + |
| 136 | + for key, _ in pairs(self.items) do |
| 137 | + do |
| 138 | + out[#out+1+1] = key |
| 139 | + end |
| 140 | + ::__continue2:: |
| 141 | + end |
| 142 | + return out |
| 143 | +end |
| 144 | +function Map.set(self,key,value) |
| 145 | + if (not self:has(key)) then |
| 146 | + self.size = (self.size+1) |
| 147 | + end |
| 148 | + self.items[key] = value |
| 149 | + return self |
| 150 | +end |
| 151 | +function Map.values(self) |
| 152 | + local out = {} |
| 153 | + |
| 154 | + for key, _ in pairs(self.items) do |
| 155 | + do |
| 156 | + out[#out+1+1] = self.items[key] |
| 157 | + end |
| 158 | + ::__continue3:: |
| 159 | + end |
| 160 | + return out |
| 161 | +end |
| 162 | + |
| 163 | +-- Generated by TypescriptToLua v0.6.0 |
| 164 | +-- https://github.com/Perryvw/TypescriptToLua |
| 165 | + |
| 166 | +-- Generated by TypescriptToLua v0.6.0 |
| 167 | +-- https://github.com/Perryvw/TypescriptToLua |
| 168 | + |
| 169 | +-- Generated by TypescriptToLua v0.6.0 |
| 170 | +-- https://github.com/Perryvw/TypescriptToLua |
| 171 | + |
| 172 | +-- Generated by TypescriptToLua v0.6.0 |
| 173 | +-- https://github.com/Perryvw/TypescriptToLua |
| 174 | +function ___TS__Ternary(condition,cb1,cb2) |
| 175 | + if condition then |
| 176 | + cb1() |
| 177 | + else |
| 178 | + cb2() |
| 179 | + end |
| 180 | +end |
| 181 | + |
0 commit comments