mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 07:29:02 -08:00
Change to file-scoped namespaces
This commit is contained in:
@@ -13,8 +13,8 @@ using FourNumbers = System.ValueTuple<float, float, float, float>;
|
|||||||
using static System.Environment;
|
using static System.Environment;
|
||||||
using static Games.Common.IO.Strings;
|
using static Games.Common.IO.Strings;
|
||||||
|
|
||||||
namespace Games.Common.IO.TextIOTests
|
namespace Games.Common.IO.TextIOTests;
|
||||||
{
|
|
||||||
public class ReadMethodTests
|
public class ReadMethodTests
|
||||||
{
|
{
|
||||||
[Theory]
|
[Theory]
|
||||||
@@ -163,4 +163,3 @@ namespace Games.Common.IO.TextIOTests
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -8,8 +8,8 @@ using Xunit;
|
|||||||
using static System.Environment;
|
using static System.Environment;
|
||||||
using static Games.Common.IO.Strings;
|
using static Games.Common.IO.Strings;
|
||||||
|
|
||||||
namespace Games.Common.IO
|
namespace Games.Common.IO;
|
||||||
{
|
|
||||||
public class TokenReaderTests
|
public class TokenReaderTests
|
||||||
{
|
{
|
||||||
private readonly StringWriter _outputWriter;
|
private readonly StringWriter _outputWriter;
|
||||||
@@ -104,4 +104,3 @@ namespace Games.Common.IO
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace Games.Common.IO
|
namespace Games.Common.IO;
|
||||||
{
|
|
||||||
public class TokenTests
|
public class TokenTests
|
||||||
{
|
{
|
||||||
[Theory]
|
[Theory]
|
||||||
@@ -40,4 +40,3 @@ namespace Games.Common.IO
|
|||||||
{ "12e0.5", true, 12 }
|
{ "12e0.5", true, 12 }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -2,8 +2,8 @@ using System.Linq;
|
|||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace Games.Common.IO
|
namespace Games.Common.IO;
|
||||||
{
|
|
||||||
public class TokenizerTests
|
public class TokenizerTests
|
||||||
{
|
{
|
||||||
[Theory]
|
[Theory]
|
||||||
@@ -31,4 +31,3 @@ namespace Games.Common.IO
|
|||||||
{ "a\"b,\" c,d\", f ,,g", new[] { "a\"b", " c,d", "f", "", "g" } }
|
{ "a\"b,\" c,d\", f ,,g", new[] { "a\"b", " c,d", "f", "", "g" } }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Games.Common.IO
|
namespace Games.Common.IO;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An implementation of <see cref="IReadWrite" /> with input begin read for STDIN and output being written to
|
/// An implementation of <see cref="IReadWrite" /> with input begin read for STDIN and output being written to
|
||||||
/// STDOUT.
|
/// STDOUT.
|
||||||
@@ -13,4 +13,3 @@ namespace Games.Common.IO
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
namespace Games.Common.IO
|
namespace Games.Common.IO;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides for input and output of strings and numbers.
|
/// Provides for input and output of strings and numbers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -66,4 +66,3 @@ namespace Games.Common.IO
|
|||||||
/// <param name="message">The <see cref="string" /> to be written.</param>
|
/// <param name="message">The <see cref="string" /> to be written.</param>
|
||||||
void WriteLine(string message);
|
void WriteLine(string message);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
namespace Games.Common.IO
|
namespace Games.Common.IO;
|
||||||
{
|
|
||||||
internal static class Strings
|
internal static class Strings
|
||||||
{
|
{
|
||||||
internal const string NumberExpected = "!Number expected - retry input line";
|
internal const string NumberExpected = "!Number expected - retry input line";
|
||||||
internal const string ExtraInput = "!Extra input ignored";
|
internal const string ExtraInput = "!Extra input ignored";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -3,8 +3,8 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Games.Common.IO
|
namespace Games.Common.IO;
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Implements <see cref="IReadWrite" /> with input read from a <see cref="TextReader" /> and output written to a
|
/// Implements <see cref="IReadWrite" /> with input read from a <see cref="TextReader" /> and output written to a
|
||||||
@@ -87,4 +87,3 @@ namespace Games.Common.IO
|
|||||||
return _input.ReadLine();
|
return _input.ReadLine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace Games.Common.IO
|
namespace Games.Common.IO;
|
||||||
{
|
|
||||||
internal class Token
|
internal class Token
|
||||||
{
|
{
|
||||||
private static readonly Regex _numberPattern = new(@"^[+\-]?\d*(\.\d*)?([eE][+\-]?\d*)?");
|
private static readonly Regex _numberPattern = new(@"^[+\-]?\d*(\.\d*)?([eE][+\-]?\d*)?");
|
||||||
@@ -57,4 +57,3 @@ namespace Games.Common.IO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -3,8 +3,8 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
using static Games.Common.IO.Strings;
|
using static Games.Common.IO.Strings;
|
||||||
|
|
||||||
namespace Games.Common.IO
|
namespace Games.Common.IO;
|
||||||
{
|
|
||||||
internal class TokenReader
|
internal class TokenReader
|
||||||
{
|
{
|
||||||
private readonly TextIO _io;
|
private readonly TextIO _io;
|
||||||
@@ -78,4 +78,3 @@ namespace Games.Common.IO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Games.Common.IO
|
namespace Games.Common.IO;
|
||||||
{
|
|
||||||
internal class Tokenizer
|
internal class Tokenizer
|
||||||
{
|
{
|
||||||
private const char Quote = '"';
|
private const char Quote = '"';
|
||||||
@@ -99,4 +99,3 @@ namespace Games.Common.IO
|
|||||||
throw new InvalidOperationException();
|
throw new InvalidOperationException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user