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 Main { | |
static function main() { | |
var s = new Signature<Int->Void>(); | |
} | |
} |
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
@:jsRequire("remote") | |
extern class Remote { | |
static function require(module:String):Dynamic; | |
} | |
extern class BrowserWindow { | |
function new(); | |
} | |
@:jsRequire("browser-window") |
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
#if macro | |
import haxe.macro.Context; | |
import haxe.macro.Expr; | |
import haxe.macro.Type; | |
using haxe.macro.Tools; | |
#end | |
abstract Choice<T>(T) from T { | |
public macro function match(self, match) { | |
switch (match.expr) { |
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
package dungeons.utils; | |
/* | |
A simple time scheduling system based on energy. Can be used for player, monsters, hp regenerators, effect counters, | |
basically everything. | |
Loosely based on python example from this article: | |
http://roguebasin.roguelikedevelopment.org/index.php?title=An_elegant_time-management_system_for_roguelikes | |
*/ |
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 Main | |
{ | |
private static function main() | |
{ | |
function newEmptyHandler():Void->Void | |
{ | |
return function():Void {}; | |
} | |
var a:Void->Void = newEmptyHandler(); |
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
package; | |
class Main | |
{ | |
public function new(root) | |
{ | |
root.addEventListener(flash.events.Event.ENTER_FRAME, onEnterFrame); | |
} | |
function onEnterFrame(_) |
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 TestUtils | |
{ | |
/** | |
* Макро-функция для удобного тестирования эксепшенов. | |
* | |
* Использовать так: | |
* assertExprRaises({ throw "OMG"; }); | |
* или так: | |
* assertExprRaises({ throw "OMG"; }, { assertThat(e, equalTo("OMG")) }); | |
* |
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
private typedef TileRule = | |
{ | |
var tileIndex:Int; | |
var map:{nw:String, n:String, ne:String, w:String, e:String, sw:String, s:String, se:String}; | |
} | |
private typedef TileType = | |
{ | |
var typeStr:String; | |
var defaultTileIndex:Int; |
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
using StringTools; | |
/** | |
* Супер-принтер для JSON. | |
* | |
* От не-супер принтера его отличают две вещи: | |
* 1. Он делает оступы | |
* 2. Он сортирует поля объектов при сериализации | |
* | |
* Он был написан для того чтобы собирать дефы под разными платформами |