Skip to content

Commit

Permalink
Moved namespaces to outer space
Browse files Browse the repository at this point in the history
  • Loading branch information
zorbathut committed Nov 4, 2024
1 parent b1c94e6 commit d144971
Show file tree
Hide file tree
Showing 116 changed files with 532 additions and 534 deletions.
3 changes: 1 addition & 2 deletions example/loaf/Bootstrap.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System.IO;

namespace Loaf
{
using System.IO;

public static class Bootstrap
{
public static void Main()
Expand Down
12 changes: 6 additions & 6 deletions example/loaf/Cns.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;

namespace Loaf
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;

// The Cns class handles console output for Loaf. This consists of two pieces of functionality.
//
// Cns.Out prints lines and does the slow-modem-transfer effect.
Expand Down
4 changes: 2 additions & 2 deletions example/loaf/Config.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;

namespace Loaf
{
using System.Collections.Generic;

// In many situations I've found it useful to have a ConfigDec class with a bunch of global parameters.
// This is simply making use of the Dec system to provide a centralized settings registry.
// It's overkill, but it's effective.
Expand Down
4 changes: 2 additions & 2 deletions example/loaf/Dbg.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;

namespace Loaf
{
using System;

internal static class Dbg
{
internal static void Inf(string str)
Expand Down
7 changes: 3 additions & 4 deletions example/loaf/Dice.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;

namespace Loaf
{
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;

// This is an example of using a custom Converter class.
// Nobody wants to write <damage><count>4</count><sides>6</sides></damage>, so instead you can just do <damage>4d6</damage>.
public class Dice
Expand Down
3 changes: 1 addition & 2 deletions example/loaf/Dungeon.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System.Linq;

namespace Loaf
{
using System.Linq;

// Recommend reading the LocationDec documentation for more information.
//
// When creating a builder like this, I recommend passing the Dec in as a constructor parameter.
Expand Down
5 changes: 2 additions & 3 deletions example/loaf/Game.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System.IO;
using System.Linq;

namespace Loaf
{
using System.IO;
using System.Linq;

public static class Game
{
// Definitely read the Loaf.Cns documentation if this is your first encounter with Cns.ChoiceDec.
Expand Down
3 changes: 1 addition & 2 deletions example/loaf/Location.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System;

namespace Loaf
{
using System;

// Locations, in this game, are declared with subclasses of a class called LocationDec. This demonstrates a few different ways to create classes on demand.
//
// The DungeonDec subclass has information tied to that type, and creates an instance type hardcoded into the DungeonDec code.
Expand Down
7 changes: 3 additions & 4 deletions example/loaf/Locations.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Loaf.Locations
{
using System.Collections.Generic;
using System.IO;
using System.Linq;

// Definitely avoid the urge to *over*generalize.
// All of these locations require custom code and it's just not worth the effort to try expressing these in XML.
// Make a class that does your thing, pass it in as a Type, be done with it.
Expand Down
11 changes: 5 additions & 6 deletions example/loaf/Player.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;

namespace Loaf
{
using System;
using System.Collections.Generic;
using System.Linq;

// For the sake of this example, we're just using a player singleton.
// It's marked IRecordable so we can save our game.
// It's marked IRecordable so we can save our game.
public class Player : SingletonManual<Player>, Dec.IRecordable
{
private List<ItemDec> inventory = new List<ItemDec>();
Expand Down Expand Up @@ -54,7 +53,7 @@ public bool SpendGold(int gold)
}

// This is the entire serialization and deserialization code.
//
//
// I recognize that this is almost suspiciously simple.
// It feels like one of those tutorials where it shows you an example that is specifically customized to the abilities of the library,
// and where any actual real-world implementation is many times more complicated and finicky.
Expand Down
5 changes: 2 additions & 3 deletions example/loaf/RollTable.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System.Collections.Generic;
using System.Linq;

namespace Loaf
{
using System.Collections.Generic;
using System.Linq;

// This is parsed by Dec as part of the DungeonDec class.
// There's no extra magic required; DungeonDec specifies which RollTable<> instantiation it is, and Dec just handles it from there.
public class RollTable<T>
Expand Down
5 changes: 2 additions & 3 deletions example/loaf/Util.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System.Collections.Generic;

namespace Loaf
{
using System;
using System.Collections.Generic;

public static class Util
{
public static T MaxOfOrDefault<T>(this IEnumerable<T> data, Func<T, float> func)
Expand Down
14 changes: 7 additions & 7 deletions extra/recorder_enumerator/src/Config.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;

namespace Dec.RecorderEnumerator
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;

public static class Config
{
private static readonly Regex UserCreatedEnumerableRegex = new Regex(@"^<([^>]+)>d__[0-9]+(?:`([0-9]+))?$", RegexOptions.Compiled);
Expand Down
6 changes: 3 additions & 3 deletions extra/recorder_enumerator/src/Dbg.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System;

namespace Dec.RecorderEnumerator
{
using System;

internal static class Dbg
{
internal static void Inf(string str)
{
global::Dec.Config.InfoHandler("RecorderEnumerator: " + str);
global::Dec.Config.InfoHandler("RecorderEnumerator: " + str);
}

internal static void Wrn(string str)
Expand Down
10 changes: 5 additions & 5 deletions extra/recorder_enumerator/src/Delegate.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;

namespace Dec.RecorderEnumerator
{
using System;
using System.IO;
using System.Linq;
using System.Reflection;

public class System_Delegate_Converter : ConverterFactory<Delegate>
{
public static bool IsGenericDelegate(Type type)
Expand Down
10 changes: 5 additions & 5 deletions extra/recorder_enumerator/src/MethodInfo.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;

namespace Dec.RecorderEnumerator
{
using System;
using System.IO;
using System.Linq;
using System.Reflection;

public class MethodInfo_Converter : ConverterFactory<MethodInfo>
{
public override bool TreatAsValuelike()
Expand Down
6 changes: 3 additions & 3 deletions extra/recorder_enumerator/src/System.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Reflection;

namespace Dec.RecorderEnumerator
{
using System;
using System.Reflection;

public class System_ArrayEnumerator_Converter : ConverterFactoryDynamic
{
internal static Type RelevantType = typeof(System.Array).Assembly.GetType("System.ArrayEnumerator");
Expand Down
8 changes: 4 additions & 4 deletions extra/recorder_enumerator/src/SystemCollections.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Reflection;

namespace Dec.RecorderEnumerator
{
using System;
using System.Collections.Generic;
using System.Reflection;

public static class SystemCollections_List_Enumerator_Converter
{
internal static Type RelevantType = typeof(System.Collections.Generic.List<>.Enumerator);
Expand Down
10 changes: 5 additions & 5 deletions extra/recorder_enumerator/src/SystemLinq.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;

namespace Dec.RecorderEnumerator
{
using System;
using System.IO;
using System.Linq;
using System.Reflection;

public static class SystemLinq_SingleLinkedNode_Converter
{
internal static Type RelevantType = typeof(System.Linq.Enumerable).Assembly.GetType("System.Linq.SingleLinkedNode`1");
Expand Down
10 changes: 5 additions & 5 deletions extra/recorder_enumerator/src/SystemLinqEnumerable.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;

namespace Dec.RecorderEnumerator
{
using System;
using System.IO;
using System.Linq;
using System.Reflection;

public class SystemLinqEnumerable_RangeIterator_Converter : ConverterFactoryDynamic
{
internal static Type RelevantType = typeof(System.Linq.Enumerable).GetNestedType("RangeIterator", System.Reflection.BindingFlags.NonPublic);
Expand Down
12 changes: 6 additions & 6 deletions extra/recorder_enumerator/src/SystemLinqEnumerable_Select.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;

namespace Dec.RecorderEnumerator
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;

public static class SystemLinqEnumerable_SelectEnumerable_Converter
{
internal static Type RelevantType = typeof(System.Linq.Enumerable).GetNestedType("SelectEnumerableIterator`2", System.Reflection.BindingFlags.NonPublic);
Expand Down
10 changes: 5 additions & 5 deletions extra/recorder_enumerator/src/SystemLinqEnumerable_Where.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;

namespace Dec.RecorderEnumerator
{
using System;
using System.IO;
using System.Linq;
using System.Reflection;

public static class SystemLinqEnumerable_WhereEnumerable_Converter
{
internal static Type RelevantType = typeof(System.Linq.Enumerable).GetNestedType("WhereEnumerableIterator`1", System.Reflection.BindingFlags.NonPublic);
Expand Down
6 changes: 3 additions & 3 deletions extra/recorder_enumerator/src/UserCreatedEnumerable.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Reflection;

namespace Dec.RecorderEnumerator
{
using System;
using System.Reflection;

[AttributeUsage(AttributeTargets.Method)]
public class RecordableEnumerableAttribute : Attribute { }

Expand Down
10 changes: 5 additions & 5 deletions extra/recorder_enumerator/src/Util.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;

namespace Dec.RecorderEnumerator
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;

internal static class Util
{
internal static void RecordPrivate(this Recorder recorder, object obj, FieldInfo field, string name)
Expand Down
6 changes: 3 additions & 3 deletions extra/recorder_enumerator/src/VariableCapture.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Reflection;

namespace Dec.RecorderEnumerator
{
using System;
using System.Reflection;

[AttributeUsage(AttributeTargets.Class)]
public class RecordableClosuresAttribute : Attribute { }

Expand Down
18 changes: 9 additions & 9 deletions extra/recorder_enumerator/test/Base.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using Dec;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;

namespace RecorderEnumeratorTest
{
using Dec;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;

[TestFixture]
public class Base : DecTest.Base
{
Expand All @@ -17,4 +17,4 @@ public void PrepConfig()
Config.ConverterFactory = global::Dec.RecorderEnumerator.Config.ConverterFactory;
}
}
}
}
Loading

0 comments on commit d144971

Please sign in to comment.