aboutsummaryrefslogtreecommitdiff
path: root/dotnet/Mammoth/Couscous/HorribleHacks.cs
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-04-14 21:12:07 +0100
committerMichael Williamson <mike@zwobble.org>2016-04-17 16:52:39 +0100
commit0f9ef005f063198ea2e16ca36beaead4bd5e3824 (patch)
tree4ec2f53e900d4cbe9e5258bca48ec0938a8a1762 /dotnet/Mammoth/Couscous/HorribleHacks.cs
parent490f87c92ff1618591d1932f23613740e79dcb4b (diff)
Add .NET output
Diffstat (limited to 'dotnet/Mammoth/Couscous/HorribleHacks.cs')
-rw-r--r--dotnet/Mammoth/Couscous/HorribleHacks.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/dotnet/Mammoth/Couscous/HorribleHacks.cs b/dotnet/Mammoth/Couscous/HorribleHacks.cs
new file mode 100644
index 0000000..88c746b
--- /dev/null
+++ b/dotnet/Mammoth/Couscous/HorribleHacks.cs
@@ -0,0 +1,21 @@
+using Mammoth.Couscous.java.util;
+using Mammoth.Couscous.org.zwobble.mammoth.@internal.documents;
+using System.Linq;
+
+namespace Mammoth.Couscous {
+ internal static class HorribleHacks {
+ internal static bool equals(this Optional<string> first, Optional<string> second) {
+ return (!first.isPresent() && !second.isPresent()) || (first.isPresent() && second.isPresent() && first.get() == second.get());
+ }
+
+ internal static bool equals(this Map<string, string> firstMap, Map<string, string> secondMap) {
+ var first = FromJava.MapToDictionary(firstMap);
+ var second = FromJava.MapToDictionary(secondMap);
+ return first.Count == second.Count && first.All(item => second.ContainsKey(item.Key) && second[item.Key] == item.Value);
+ }
+
+ internal static bool equals(this NoteType first, NoteType second) {
+ return first == second;
+ }
+ }
+}