From 9b56f12ae63850c764354fad9ccd3424c975d1f8 Mon Sep 17 00:00:00 2001 From: Zontreck Date: Fri, 16 Feb 2024 14:56:33 -0700 Subject: [PATCH] Finish the API --- .../java/dev/zontreck/ariaslib/util/Percent.java | 1 - .../java/dev/zontreck/ariaslib/util/TimeUtil.java | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/dev/zontreck/ariaslib/util/Percent.java b/src/main/java/dev/zontreck/ariaslib/util/Percent.java index da4b2ab..3b51a2b 100644 --- a/src/main/java/dev/zontreck/ariaslib/util/Percent.java +++ b/src/main/java/dev/zontreck/ariaslib/util/Percent.java @@ -2,7 +2,6 @@ package dev.zontreck.ariaslib.util; import java.io.PrintStream; -@Deprecated public class Percent { int current; diff --git a/src/main/java/dev/zontreck/ariaslib/util/TimeUtil.java b/src/main/java/dev/zontreck/ariaslib/util/TimeUtil.java index 33991c8..b1f8d28 100644 --- a/src/main/java/dev/zontreck/ariaslib/util/TimeUtil.java +++ b/src/main/java/dev/zontreck/ariaslib/util/TimeUtil.java @@ -55,6 +55,21 @@ public class TimeUtil return new TimeNotation(years, month, week, day, hour, minute, seconds); } + public static int notationToSeconds(TimeNotation notation) + { + int seconds = 0; + + seconds += (notation.Years * YEAR); + seconds += (notation.Months * MONTH); + seconds += (notation.Weeks * WEEK); + seconds += (notation.Days * DAY); + seconds += (notation.Hours * HOUR); + seconds += (notation.Minutes * MINUTE); + seconds += (notation.Seconds); + + return seconds; + } + public static final int SECOND; public static final int MINUTE;