Skip to content

Instantly share code, notes, and snippets.

{
"compliance":{
"id":"compliance",
"kind":"BusinessUnit",
"properties":{
"name":"Compliance / Legal",
"description":"description",
"position":{
"x":-1,
"y":-1,
Crystal Castles - Magic Spells
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// given a collection of named geometry primitives (modelled using case classes)
case class A(pt: Point)
case class B(pt: Point, poly: Polygon)
case class C(pt: Point, poly: Polygon, mp: MultiPolygon)
// I would like to have an easily accessible way to apply a transformation to each element
implicit class AOps(a: A) {
def transform(tf: AffineTransformation): A = A(
a.pt.transform(tf)
)
val pE: UnDiEdge[Point] = p1 ~ p2
val pp: Seq[Point] = pE match {
case p1 ~ p2 =>
Seq(p1, p2)
}
val gg: Graph[Point, UnDiEdge] = Graph(pE)
val pp2: collection.Set[Seq[Any]] = gg.edges.map {
case p1 ~ p2 =>
Seq(p1, p2)
var Hex = Java.type('com.div8.grids.hex.Hex')
var ExpandTerritory = Java.type('com.div8.game.domain.commands.ExpandTerritory')
const onInit = function (ctx, schema) {
const state = {
status: "Starting..."
}
return state
}
/*
Style A
*/
var Hex = Java.type('com.div8.grids.hex.Hex')
var ConstructBuilding = Java.type('com.div8.game.domain.commands.ConstructBuilding')
var script = new Strategy() {
onTick: function(schema, gameState, strategyState) {
env.log("hello")
import com.google.gson.Gson;
/**
* Created by martin on 26/05/14.
*/
public class Main {
public Main() {
Room room = new Room(4, 3);
for(int y = 0; y < room.height; y++) {
public class Tile {
private final boolean walkable;
private final char symbol;
private final Color color;
public Tile(boolean walkable, char symbol, Color color) {
this.walkable = walkable;
this.symbol = symbol;
this.color = color;
}
import java.awt.*;
/**
* Created by martin on 26/05/14.
*/
public class Room {
public final int width;
public final int height;