Skip to content

Instantly share code, notes, and snippets.

View VirtuosiMedia's full-sized avatar

Virtuosi Media VirtuosiMedia

View GitHub Profile
"superconductiveLayers": {
"id": "superconductiveLayers",
"name": "Superconductive Layers",
"singular": "Superconducting Layer",
"description": "An aerosol coating of titanion, a titanium alloy and a Type III superconductor.",
"category": "power",
"image": "powerResearch",
"craftable": true,
"manufacturable": true,
"constructionPoints": 100,
{
"data.resources": {
"air": {
"name": "Air",
"id": "air",
"description": "A mixture of gases that form a breathable atmosphere, air is produced by atmospheric bioreactors.",
"basePrice": 4,
"mass": 1.3,
"image": "oxygenStorage"
},
/**
* Gets a sorted purchase order goods list for the selected category of goods.
* @return {array} The sorted list of goods objects.
*/
getPurchaseGoods: function(){
//Get all goods that should be rendered
var trade = jg.calculate.trade;
var holding = jg.data.state.holding;
var resources = _.container(_.language.getDataSet('resources'));
var components = _.container(_.language.getDataSet('items'));
/**
* Renders the purchase table in the trade center.
*/
renderPurchaseTable: function(){
var self = jg.templates.commercial.tradeCenter();
var goods = self.getPurchaseGoods();
var template = _.f();
var table = jg.ui.table({id: 'purchaseTable'});
table.setHeaders({
/**
* Renders the purchase tab panel in the trade center.
* @param - object goodsCategories - The alphabetized list categories for goods.
* @return - The rendered tab panel as an HTML object.
*/
renderPurchaseTab: function(goodsCategories){
var template = _.f();
var purchaseSelect = jg.ui.forms.select(goodsCategories, jg.data.state.commercial.trade.purchaseCategory, {
'id': 'purchaseCategory',
/**
* Renders the main container for the trade center.
*/
render: function(){
var template = _.f();
var header = _.e('div.header');
var breadcrumb = jg.ui.breadcrumb({'commercial': 'commercial.overview', 'tradeCenter': null}).inject(header);
header.inject(template);
@VirtuosiMedia
VirtuosiMedia / tradeCenter.json
Last active April 6, 2016 19:18
lange/en-US/commercial/tradeCenter.json
{
"insufficientCreditsOrderTitle": "Order Cannot Be Placed",
"insufficientCreditsOrderDescription": "You have insufficient credits to place this order. Change the order type to 'Trade' or adjust the price or quantity of your order.",
"insufficientGoodsProposalTitle": "Sales Proposal Cannot Be Made",
"insufficientGoodsProposalDescription": "You have insufficient inventory quantities for your current proposal. Change the order type to 'Trade' or adjust the quantity of your sales proposal.",
"noGoodsInCategory": "There is nothing in your inventory for this category of goods.",
"purchaseGoods": "Purchase Goods",
"sellGoods": "Sell Goods",
"tradeCenterDescription": "Select goods that ships should trade with Junction Gate."
}
@VirtuosiMedia
VirtuosiMedia / gist:7505760
Created November 16, 2013 21:46
This is a proof-of-concept for a JavaScript Autoloader. It works, but I haven't yet been able to figure out how to recover from the error without having to re-execute all of the app function. Ideally, it would deal with the error and then try that line again.
<!doctype html>
<html>
<head>
</head>
<body>
<script type="text/javascript">
var app = function(){
console.log('Initialize App');
var test = new Test();
var foo = new Foo();
/**
* Utility class for dealing with SVG elements
* Copyright Virtuosi Media, Inc. 2012
* MIT License
*/
var SVG = new Class({
/**
* @param string - el - The type of SVG element
* @param object - options - The attributes and values for the SVG element, stored in a hash
@VirtuosiMedia
VirtuosiMedia / Chess.php
Created September 10, 2012 03:42
Demo classes for moving chess pieces
<?php
/**
* @description An abstract class for all chess pieces
* @author Benjamin Kuker
*/
abstract class ChessPiece {
protected $color = null;
protected $constraints = array();
protected $currentPosition = null;