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
"use strict"; | |
let funcRegex = /^\s*function(\*)?\s*(?:\s+(.+?))?\((.*?)\)\s*{\s*(.*?)\s*}\s*$/m; | |
let arrowFuncRegex = /^\s*\(?(.*?)\)?\s*=>\s*{?\s*(.*?)\s*}?\s*$/m; | |
let parameterRegex = /^\s*(\.\.\.)?(.+?)(?:\s*=\s*(.+?))?\s*$/m; | |
/** Inspects the specified function and returns an object containing | |
* information about it and its parameters. Note: This breaks down | |
* when using certain strings or functions as default value parameters. */ | |
exports.inspectFunction = function(func) { |
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
import { Server as WebSocketServer } from "uws"; | |
import winston from "winston"; | |
import Client from "./Client"; | |
import { AsyncEventEmitter } from "../../common/utility"; | |
const defaultOptions = { | |
wssOptions: { | |
port: 8080 |
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
/* | |
* O/==================================\O * | |
* |====[ obsidian Engine Language ]====| * | |
* |====[ ~ Definition ~ ]====| * | |
* O\==================================/O * | |
* | |
* Motivated by JAI, another language in development: | |
* https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md | |
* Also taking some inspiration from C#. | |
* Work In Progress ... obviously. |
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
"use strict"; | |
let Iterable = module.exports = class Iterable { | |
constructor(iterable) { | |
if (iterable instanceof Function) | |
this[Symbol.iterator] = iterable; | |
else if (Iterable.isIterable(iterable)) | |
this[Symbol.iterator] = iterable[Symbol.iterator].bind(iterable); | |
else throw new Error("iterable is neither a function nor an iterable"); |
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
use std::any::Any; | |
use std::any::TypeId; | |
use std::hash::Hash; | |
use std::collections::HashMap; | |
#[derive(PartialEq, Eq, Clone, Copy, Hash, Debug)] | |
pub struct Entity(i32); | |
pub trait Component: Any { } |
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
/** Represents arbitrary data that can be added to any object that implements IComponentsProvider. | |
* For example: Block, Item, Entity, ItemStack, Enchantment, Biome, ... | |
* | |
* Components are required to have an empty public constructor so they can be loaded / saved and | |
* getOrCreate can be used. */ | |
public interface IComponent { | |
/** Serializes (saves) this component as an NBT tag. | |
* If null is returned, the component won't be saved. */ | |
Tag serialize() { return null; } | |
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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using EntitySystem.Utility; | |
namespace EntitySystem.Collections | |
{ | |
public class Dictionary<TKey, TValue> : IDictionary<TKey, TValue>, IReadOnlyDictionary<TKey, TValue> |
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
name: copypack | |
description: ... | |
authors: [ nikky, copygirl ] | |
links: | |
website: ... | |
source: ... | |
issues: ... | |
donations: ... | |
minecraftVersion: 1.11.2 |
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
import options, tables | |
import ../entity | |
template simpleTableComponent*(Type, name) = | |
let table = newTable[Entity, Type]() | |
proc name*(entity: Entity): Option[Type] = | |
try: table[entity].some | |
except KeyError: Type.none | |
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
package net.mcft.copy.backpacks.client.gui.test; | |
import net.minecraft.client.gui.GuiScreen; | |
import net.mcft.copy.backpacks.client.config.BackpacksGuiConfig; | |
import net.mcft.copy.backpacks.client.gui.Direction; | |
import net.mcft.copy.backpacks.client.gui.GuiContainer; | |
import net.mcft.copy.backpacks.client.gui.GuiContainerScreen; | |
import net.mcft.copy.backpacks.client.gui.GuiLayout; | |
import net.mcft.copy.backpacks.client.gui.control.GuiButton; |