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
def listen_event(self, event, *args, **kwargs): | |
'''Fires an event.''' | |
events = self.__events.get(event, {}) | |
for key in events: | |
for val in events[key](*args, **kwargs): | |
yield val | |
# example |
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
import java.util.AbstractCollection; | |
import java.util.Iterator; | |
import java.util.Random; | |
import java.util.Vector; | |
public class RandomWord { | |
public static void main(String []args){ | |
Vector<Item<String>> words = new Vector<Item<String>>(); | |
words.add(new Item<String>("Hello", 3)); | |
words.add(new Item<String>("World", 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
extends Node | |
class Task: | |
var id : int | |
signal completed | |
func _init(id: int): | |
self.id = id |