Skip to content

Instantly share code, notes, and snippets.

View martindevans's full-sized avatar

Martin Evans martindevans

View GitHub Profile
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;
//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);
}
//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()
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
#[deriving(Clone)]
enum Noun
{
Atom(int),
Cell(~Noun, ~Noun)
}
fn wut(n: &Noun) -> Noun
{
match n
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)
// 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--;
#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)
// .h file
#pragma once
#include "Ship_Component_Interface.generated.h"
/**
*
*/
UINTERFACE(MinimalAPI)
// .h file
#pragma once
#include "Ship_Component_Interface.generated.h"
/**
*
*/
UINTERFACE(MinimalAPI)
class UShip_Component_Interface : public UInterface