Skip to content

Instantly share code, notes, and snippets.

View adam-arold's full-sized avatar
💭
Exploring the n'th dimension.

Adam Arold adam-arold

💭
Exploring the n'th dimension.
View GitHub Profile
@adam-arold
adam-arold / contentGateway.ts
Created September 20, 2021 13:00
ContentGateway DEMO
/* eslint-disable @typescript-eslint/no-explicit-any */
import * as E from "fp-ts/Either";
import * as t from "io-ts";
/**
* Contains the necessary fields that are required to uniquely
* identify a specific event.
* The generic type parameter is necessary for type safety.
*/
java -jar build/libs/caves-of-zircon.jar
git reset --hard PROJECT_SETUP
@adam-arold
adam-arold / git.sh
Last active January 12, 2019 00:07
cd caves-of-zircon-tutorial
git clone https://github.com/Hexworks/caves-of-zircon-tutorial.git
fun <T: Event> Observable<T>.onEvent(fn: (Event) -> Unit){
onEvent(object : Listener<T> {
override fun accept(event: T) {
fn(event)
}
})
}
observable.onEvent(object : Listener<Event>{
override fun accept(event: Event) {
// ...
}
})
interface Observable <T: Event> {
fun onEvent(listener: Listener<T>)
}
// Oops! Function1 wanted!
observable.onEvent(/* */);
interface Observable<T : Event> {
fun onEvent(fn: (T) -> Unit)
}