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
//place this script in the Editor folder within Assets. | |
using UnityEditor; | |
//to be used on the command line: | |
//$ Unity -quit -batchmode -executeMethod WebGLBuilder.build | |
class WebGLBuilder { | |
static void build() { | |
string[] scenes = {"Assets/main.unity"}; |
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 enum Singleton { | |
INSTANCE; | |
private Singleton() { } | |
} |
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
require 'rubygems' | |
require 'sinatra' | |
set :port, 80 | |
set :bind, '0.0.0.0' | |
get "/*" do | |
host = request.host | |
path = request.path |
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
require 'rubygems' | |
require 'sinatra' | |
require 'data_mapper' | |
require 'json' | |
require 'thin' | |
class MyThinBackend < ::Thin::Backends::TcpServer | |
def initialize(host, port, options) | |
super(host,port) |
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
namespace MHS { | |
interface ISpinner { | |
public void spin(Vector3 value); | |
} | |
[Serializable] | |
public SpinController { //we can instantiate this in a test | |
public float speed; | |
public Vector3 axis; | |
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
using UnityEngine; | |
namespace MHS.Tests { | |
public class MyLogic { | |
public int speed = 5; | |
public int position = 0; | |
public void tick(float timeStep) { | |
position = position + speed*time; | |
} | |
} |
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
using UnityEngine; | |
using System.Collections.Generic; | |
namespace MHS { | |
public struct SUITS { | |
HEARTS, | |
SPADES, | |
CLUBS, | |
DIAMONDS | |
} |
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 FoundationCell extends Cell { | |
@UsesCellComponent | |
private SharedStateComponent ssc; | |
private SharedMapImpl sharedMap; | |
protected CollaborativeString CollaborativeString(String value) { | |
return new CollaborativeString(value); |
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 interface Obj { | |
protected void doSomething(); | |
} | |
public class ObjImpl implements Obj { | |
protected void doSomething() { | |
int x = 5*5; | |
} | |
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 Cell { | |
//Do we need to contractually obligate developers to only use a single instance of a component based on class? | |
//The difference is in using a List or a Map. | |
Collection<State> states; | |
//Given an enum of types: Text, 2D, JME3 | |
//We should keep track of the various views in a map. No two instances of a cell view should have the same type | |
Map<EnumViewType, CellView> views; | |
//The alternative here is to have a single view with view components | |
NewerOlder