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
const commons = { | |
initialize: function (ctx) { | |
const newCtx = {}; | |
// Create a shallow copy of the provided context. | |
for(var key in ctx) { | |
newCtx[key] = ctx[key]; | |
} | |
// Since fengari-web is primarily a browser library, |
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
class Map | |
new: => | |
@map = {} | |
get: (i, j) => | |
if not @map[i] | |
@map[i] = {} | |
@map[i][j] |
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
class EndlessKeyValuePair | |
new: (__value) => | |
rawset @, "__value", __value | |
dotcut = (str) -> | |
pos = (string.find str, "%.") or 0 | |
key = str\sub 1, pos - 1 | |
remainder = str\sub pos + 1, -1 |
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
--@name Mooncopter | |
--@server | |
--@model models/squad/sf_plates/sf_plate3x3.mdl | |
-- Please compile it yourself. | |
-- Either download the moon compiler, | |
-- or https://moonscript.org/compiler/ | |
-- don't forget to copy and paste the directives above |