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
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
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
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
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 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
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; |
NewerOlder