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
{ | |
"compliance":{ | |
"id":"compliance", | |
"kind":"BusinessUnit", | |
"properties":{ | |
"name":"Compliance / Legal", | |
"description":"description", | |
"position":{ | |
"x":-1, | |
"y":-1, |
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
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.
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
// 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) | |
) |
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
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) |
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
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 | |
} |
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
/* | |
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") |
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
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++) { |
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
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; | |
} |
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
import java.awt.*; | |
/** | |
* Created by martin on 26/05/14. | |
*/ | |
public class Room { | |
public final int width; | |
public final int height; |