More of The Big Refactor.
[VOID.git] / Tools / VOID_Tools.cs
blob:a/Tools/VOID_Tools.cs -> blob:b/Tools/VOID_Tools.cs
--- a/Tools/VOID_Tools.cs
+++ b/Tools/VOID_Tools.cs
@@ -34,7 +34,7 @@
 
 namespace VOID
 {
-	public static partial class VOID_Tools
+	public static class VOID_Tools
 	{
 		#region CelestialBody Utilities
 		public static bool hasAncestor(this CelestialBody bodyA, CelestialBody bodyB)
@@ -365,6 +365,19 @@
 			return functionCache[hashCode];
 		}
 
+		public static void UncacheWindow(Action<int> func)
+		{
+			if (functionCache != null)
+			{
+				int hashCode = func.GetHashCode();
+
+				if (functionCache.ContainsKey(hashCode))
+				{
+					functionCache.Remove(hashCode);
+				}
+			}
+		}
+
 		/// <summary>
 		/// Formats the interval given in seconds as a human-friendly
 		/// time period in [[[[years, ]days, ]hours, ]minutes, and ]seconds.
@@ -516,9 +529,9 @@
 
 			public string FormatAsDate()
 			{
-				string format = "Y{0:D1}, D{1:D1} {2:D2}:{3:D2}:{4:00.0}s";
-
-				return string.Format(format, years, days, hours, minutes, seconds);
+				string format = "Y{0:#0}, D{1:#0} {2:00}:{3:00}:{4:00.0}s";
+
+				return string.Format(format, years + 1, days + 1, hours, minutes, seconds);
 			}
 
 			public UnpackedTime(int years, int days, int hours, int minutes, double seconds)