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 your.package.here; | |
/** | |
* @author Harrison, Alias: Hc747, Contact: [email protected] | |
* @version 1.0 | |
* @since 12/3/18 | |
*/ | |
public class LinkedList<T> { | |
private Node head; |
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
interface IndexedEntity<T : IndexedEntity<T>> { | |
var index: EntityIndexReference<T>? | |
} | |
class EntityIndexReference<T : IndexedEntity<T>> internal constructor(val container: EntityList<T>, val entity: T, val index: Int) | |
class EntityList<T : IndexedEntity<T>>(private val capacity: Int) : AbstractCollection<T>() { |
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
interface IndexedEntity<T : IndexedEntity<T>> { | |
var index: EntityIndexReference<T>? | |
} | |
class EntityIndexReference<T : IndexedEntity<T>> internal constructor(val container: EntityList<T>, val entity: T, val index: Int) | |
class EntityList<T : IndexedEntity<T>>(private val capacity: Int) : AbstractCollection<T>() { |
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
interface Entity | |
class Player(val name: String) : Entity | |
class NPC(val type: String) : Entity | |
enum class EventKey { | |
INIT, | |
PROCESS, | |
FINISH | |
} |
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
interface Entity | |
class Player(val name: String) : Entity { | |
fun say(message: String) = println("$name: $message") | |
} | |
class NPC(val type: String) : Entity |
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 DiscordRichPresenceUpdate(private val details: String?, private val state: String?, private val key: String?) { | |
fun encode(): PacketBuilder { | |
val buffer = PacketBuilder() | |
val builder = PacketBuilder(PACKET_ID, PacketType.BYTE) | |
var mask: Byte = 0 | |
if (details != null) { | |
mask = mask xor DETAILS_MASK |
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 DiscordRichPresenceUpdate(private val details: String?, private val state: String?, private val key: String?) { | |
fun encode(): PacketBuilder { | |
val buffer = PacketBuilder(PACKET_ID, PacketType.BYTE) | |
val builder = PacketBuilder() | |
var mask: Byte = 0 | |
if (details != null) { |
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 main | |
import ( | |
"net/http" | |
"time" | |
"io/ioutil" | |
"fmt" | |
"net/url" | |
) |
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
export default class User { | |
constructor(username, email, password_hash, session_token) { | |
this.username = username; | |
this.email = email; | |
this.password_hash = password_hash; | |
this.session_token = session_token; | |
} | |
isAuthenticated() { |
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 express = require('express'); | |
const router = express.Router(); | |
//TODO: put models into own package | |
class IdentifiableModel { | |
//TODO: proptypes or typescript | |
constructor(id) { | |
this.id = id; | |
} |
OlderNewer