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
.Lambda #Lambda1<Squared.Util.DeclarativeSort.Sorter`1+ValueComparer[Squared.Util.DeclarativeSort.TaggableWithIndex]>( | |
Squared.Util.DeclarativeSort.TaggableWithIndex& $lhs, | |
Squared.Util.DeclarativeSort.TaggableWithIndex& $rhs) { | |
.Block(System.Int32 $result) { | |
$result = .Block(System.Int32[] $sortKeys) { | |
$sortKeys = .Constant<Squared.Util.DeclarativeSort.Sorter`1+TagSortRule[Squared.Util.DeclarativeSort.TaggableWithIndex]>(Squared.Util.DeclarativeSort.Sorter`1+TagSortRule[Squared.Util.DeclarativeSort.TaggableWithIndex]).SortKeys; | |
$sortKeys[($lhs.Tags).Id] - $sortKeys[($rhs.Tags).Id] | |
}; | |
.If ($result != 0) { | |
.Goto return-result { } |
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
.method public static | |
void Main ( | |
string[] '' | |
) cil managed | |
{ | |
// Method begins at RVA 0x20f4 | |
// Code size 134 (0x86) | |
.maxstack 12 | |
.entrypoint |
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
private static readonly Dictionary<string, Func<HttpListenerContext, IEnumerator<object>>> Handlers = | |
new Dictionary<string, Func<HttpListenerContext, IEnumerator<object>>> { | |
{"/api/list_playable_levels", ServePlayableLevelsList} | |
}; |
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.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Squared.Util; | |
using Squared.Util.Event; | |
using ThreesTown.Entities.EntityType; | |
using ThreesTown.Framework; | |
using ThreesTown.Modes; |
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
IEnumerable<TilePlacement> PlacementsOrderedAlongAxis ( | |
Pair<int> direction, | |
int minX = int.MinValue, int minY = int.MinValue, | |
int exclusiveMaxX = int.MaxValue, int exclusiveMaxY = int.MaxValue | |
) { | |
minX = Math.Max(0, minX); | |
minY = Math.Max(0, minY); | |
exclusiveMaxX = Math.Min(exclusiveMaxX, Playfield.WidthInTiles); | |
exclusiveMaxY = Math.Min(exclusiveMaxY, Playfield.HeightInTiles); | |
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 BearSpawner : AnchoredEntitySpawner<Bear> { | |
public Bear Bear; | |
public BearSpawner (ThreefoldTrialsGame game, Tile anchor) | |
: base(game, anchor) { | |
if (anchor.Type != TileType.BearDen) | |
throw new ArgumentException("anchor"); | |
Bear = new Bear(this); |
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 static void FisherYates<T> (List<T> values) { | |
var n = values.Count; | |
for (var i = 0; i < n; i += 1) { | |
var j = ThreefoldTrials.Game.RNG.Next(i, n); | |
var temp = values[j]; | |
values[j] = values[i]; | |
values[i] = temp; | |
} | |
} |
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
A few variations on this core theme: | |
"The cream will rise to the top" | |
"Good games will find an audience" | |
"Create something truly special and you will be successful" | |
These lines of thinking are all COMPLETE AND UTTER NONSENSE. I would love to live in a world where those statements were true, but they are not. They have never been true in video games, even if they are perhaps true in other industries. Anyone with any experience observing games development, sales and marketing knows that these statements are false. |
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
private void DrawIsPlaying (Frame frame, ref ImperativeRenderer renderer) { | |
var renderData = new RenderData(frame, Game.ScreenSize, Game.PlayfieldRenderTarget); | |
using (var playfieldGroup = BatchGroup.ForRenderTarget( | |
renderer.Container, renderer.Layer + 1, | |
Game.PlayfieldRenderTarget, SetupPlayfieldView, UnSetupPlayfieldView, Game.PlayfieldRenderTarget | |
)) | |
using (var playfieldCroppedGroup = BatchGroup.New( | |
playfieldGroup, 0, | |
SetupPlayfieldScissor, UnSetupPlayfieldScissor, Game.PlayfieldRenderTarget |
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
Game.InputControls.LeftMouse.AddListener(OnLeftMouse); | |
} | |
public bool OnLeftMouse (InputControl ic, InputEvent ie) { | |
if (Game.IsPaused) | |
return false; | |
if (!Game.InputControls.MouseLocation.HasValue) | |
return false; |
OlderNewer