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
for (int i = 0; i < roads.Length; i++) | |
{ | |
fixed (RoadEdge* road = &roads[i]) | |
{ | |
fixed (RoadEdge* next = &roads[(i + 1) % roads.Length]) | |
{ | |
fixed (RoadEdge* previous = &roads[(i + roads.Length - 1) % roads.Length]) | |
{ | |
//Calculate intersection in junction local space, then move back into world space | |
road->LeftProjection = Intersection2D(road->L1, road->L2, next->R1, next->R2) + topology.Position; |
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
//Usage: | |
ApiCallGetResult(ProcessSteamCallRequestLobbyList, LobbyMatchList_t, result.m_nLobbiesMatching, uint32); | |
ApiCallResult<uint32> SteamMatchmakingWrapper::RequestLobbyList() | |
{ | |
SteamAPICall_t call = SteamMatchmaking()->RequestLobbyList(); | |
return ApiCallResult<uint32>(call, LobbyMatchList_t().k_iCallback, &ProcessSteamCallRequestLobbyList); | |
} |
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
//Called in Game Initialize | |
public static void Load(string gameName, bool suppressConfigScan = false) | |
{ | |
if (!suppressConfigScan) | |
ScanForConfigurationClasses(); | |
} | |
private static void ScanForConfigurationClasses() | |
{ | |
var loads = (from assembly in GetPlaceholderAssemblies() |
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 System; | |
using System.Diagnostics; | |
using System.Threading; | |
using Myre.Entities.Services; | |
using NLog; | |
namespace Epimetheus.Services | |
{ | |
/// <summary> | |
/// A base class for a service that does continuous work in another thread |
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
#[deriving(Clone)] | |
enum Noun | |
{ | |
Atom(int), | |
Cell(~Noun, ~Noun) | |
} | |
fn wut(n: &Noun) -> Noun | |
{ | |
match n |
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 System; | |
namespace Epimetheus.Extensions | |
{ | |
/// <summary> | |
/// Turns String.Format("foo", bar) into "foo".Format(bar) | |
/// </summary> | |
public static class StringExtensions | |
{ | |
public static string Format(this string formatString, object arg) |
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
// Depending on the endianness of the architecture either copy the number (reversing bytes to switch into network order) or just directly copy the bytes | |
#if ENDIANNESS == LITTLE_ENDIAN | |
// Copies *count* bytes from src to dst but reverses the bytes in the process | |
void memcpyBackwards(void* dst, void* src, int length) | |
{ | |
byte* dstb = (byte*)dst; | |
byte* srcb = (byte*)src + length - 1; | |
for (int i = 0; i < length; i++) | |
*dstb++ = *srcb--; |
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
#include "Http.h" | |
// Create the HTTP server | |
HttpServer server = HttpServer(); | |
/* Everything in this block is an object which responds to HTTP verbs about a single integer value */ | |
int value = 0; | |
// GET the value | |
// - just write the raw bytes into the response body) |
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
// .h file | |
#pragma once | |
#include "Ship_Component_Interface.generated.h" | |
/** | |
* | |
*/ | |
UINTERFACE(MinimalAPI) |
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
// .h file | |
#pragma once | |
#include "Ship_Component_Interface.generated.h" | |
/** | |
* | |
*/ | |
UINTERFACE(MinimalAPI) | |
class UShip_Component_Interface : public UInterface |
OlderNewer