private void SetupStacks(StackType stackType, string configName, Vector2 panelPosition, InitialPosition[] initialPosition, Vector2 offset) { var subPath = stackType.ToString() + "s"; var elementCounts = ConfigLoader.Load(subPath, configName); var elementsList = Stack.GetElements(elementCounts); int countInStack = elementsList.Count / GameSettings.NumberOfPlayers; elementsList.Shuffle(); var stackElementLists = elementsList.ChunkBy(countInStack + 1); for (var i = 0; i < stackElementLists.Count; ++i) { Spawner.SpawnStack(stackType, panelPosition * initialPosition[i].BoardQuarter + offset, $"Graphics/{subPath}/Common", stackElementLists[i]); } }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { ILRange.WriteTo(output, options); if (options.UseLogicOperationSugar && MatchLogicNot(out var arg)) { output.Write("logic.not("); arg.WriteTo(output, options); output.Write(')'); return; } output.Write(OpCode); output.Write('.'); output.Write(InputType.ToString().ToLower()); switch (Sign) { case Sign.Signed: output.Write(".signed"); break; case Sign.Unsigned: output.Write(".unsigned"); break; } switch (LiftingKind) { case ComparisonLiftingKind.CSharp: output.Write(".lifted[C#]"); break; case ComparisonLiftingKind.ThreeValuedLogic: output.Write(".lifted[3VL]"); break; } output.Write('('); Left.WriteTo(output, options); output.Write(' '); output.Write(Kind.GetToken()); output.Write(' '); Right.WriteTo(output, options); output.Write(')'); }
public static void Write(this ITextOutput output, StackType stackType) { output.Write(stackType.ToString().ToLowerInvariant()); }
public override string ToString() { return("stack_" + stack_type.ToString() + "(" + loc.ToString() + ")" + ((offset_within_loc == 0) ? "" : (" + " + offset_within_loc.ToString()))); }