Created
May 24, 2012 03:03
-
-
Save dpeek/2779204 to your computer and use it in GitHub Desktop.
Entities
This file contains hidden or 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
// declaration | |
class TestEntity extends Entity | |
{ | |
@:attr var attribute:Int = 0; | |
} | |
// haxe | |
test1.attribute = 10; | |
test1.attribute.bind(test2.attribute); | |
// js inline | |
test1.set(0,test1.attribute,test1.attribute = 10); | |
test1._listen(0,function(v) { | |
test2.set(0,test2.attribute,test2.attribute = test1.attribute); | |
}); | |
// js normal | |
test1.set_attribute(10); | |
test1._listen(0,function(v) { | |
test2.set_attribute(test1.attribute); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment