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
| private static LeaderboardName getLeaderboardName( | |
| Kind kind, LeaderboardKind lbKind | |
| ) { | |
| return new LeaderboardName( | |
| kind.match().returning<string> | |
| .when<Kind.Global>(_ => string.Format( | |
| "lb_{0}", leaderboardKindToString(lbKind) | |
| )) | |
| .when<Kind.World>(kw => string.Format( | |
| "lb_w{0}_{1}", kw.world, leaderboardKindToString(lbKind) |
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; | |
| namespace Utils.Match { | |
| public interface IMatcher<in Base, Return> where Base : class { | |
| IMatcher<Base, Return> when<T>(Func<T, Return> onMatch) | |
| where T : class, Base; | |
| Return get(); | |
| Return getOrElse(Func<Return> elseFunc); | |
| } |
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
| private def getLeaderboardName(kind: Kind, lbKind: LeaderboardKind) = kind match { | |
| case kg @ Kind.Global => | |
| LeaderboardName(s"lb_${leaderboardKindToString(lbKind)}", lbKind) | |
| case Kind.World(w) => | |
| LeaderboardName(s"lb_w${w}_${leaderboardKindToString(lbKind)}", lbKind) | |
| case Kind.Level(w, l, b) => | |
| LeaderboardName( | |
| s"lb_w${w}_l$l${if (b) "b" else "")}_${leaderboardKindToString(lbKind)}", | |
| lbKind | |
| ) |
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
| public abstract class Kind { | |
| public class Global : Kind {} | |
| public class World : Kind { | |
| public readonly int world; | |
| public World(int world) { | |
| this.world = world; | |
| } | |
| } |
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 UnityEngine; | |
| class TestCallback { | |
| public static AndroidJavaObject apply<T1, T2>(Action<T1, T2> action) { | |
| var cb = new AndroidJavaObject("TestCallback"); | |
| cb.Call("setRunnable", new AndroidJavaRunnable(() => { | |
| var p1 = cb.Call<T1>("getParam1"); | |
| var p2 = cb.Call<T2>("getParam2"); | |
| action.Invoke(p1, p2); |
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 UnityEngine; | |
| namespace com.tinylabproductions.u3d_gps_bridge { | |
| public class ConnectionCallbacks : AndroidJavaProxy { | |
| public ConnectionCallbacks() : | |
| base("com.tinylabproductions.u3d_gps_bridge.ConnectionCallbacks") | |
| {} | |
| public Action OnConnected = delegate {}; |
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
| val chiShape = RootProject(file("vendor/chi-shape")) | |
| val kdTree = RootProject(file("vendor/kdtree")) | |
| val messaging = RootProject(file("vendor/messaging")) | |
| val datadog = RootProject(file("vendor/datadog-metrics-client")) | |
| val logbackLayout = RootProject(file("vendor/logback-layout")) | |
| dist <<= ( | |
| dist, | |
| packageBin in Compile in chiShape, |
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: ensuring add-apt-repository is installed | |
| apt: pkg=python-software-properties state=latest | |
| - name: adding webupd8 ppa for java7 installer | |
| apt_repository: repo=ppa:webupd8team/java | |
| - name: updating apt cache | |
| apt: update_cache=yes |
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
| case class ViewRow[K, V, D](id: String, key: K, value: V, doc: Option[D]) | |
| def viewRowFormat[K : Format, V : Format, D : Format] = ( | |
| (__ \ 'id).format[String] ~ | |
| (__ \ 'key).format[K] ~ | |
| (__ \ 'value).format[V] ~ | |
| (__ \ 'doc).formatNullable[D] | |
| ).apply(ViewRow.apply, unlift(ViewRow.unapply[K, V, D])) |
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 models | |
| import play.api.libs.json._ | |
| import play.api.libs.json.Json._ | |
| import play.api.libs.functional.syntax._ | |
| import org.apache.commons.codec.binary.Base64 | |
| /** | |
| * Created with IntelliJ IDEA. | |
| * User: arturas |