From 47264b5a455ac9b6dc1b6f902857ad5ac8c41ff5 Mon Sep 17 00:00:00 2001
From: Don Zhu <85122787+DZ-FSDev@users.noreply.github.com>
Date: Thu, 10 Feb 2022 08:51:30 -0600
Subject: [PATCH 1/3] Create SIUnit.cs
---
src/main/cs/SIUnit.cs | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 src/main/cs/SIUnit.cs
diff --git a/src/main/cs/SIUnit.cs b/src/main/cs/SIUnit.cs
new file mode 100644
index 0000000..7910309
--- /dev/null
+++ b/src/main/cs/SIUnit.cs
@@ -0,0 +1,28 @@
+/* Original Licensing Copyright
+ *
+ * Contains all International System of Units constants and definitions.
+ * Copyright (C) 2021 DZ-FSDev
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+namespace COM.DZ_FSDev.Physics
+{
+ ///
+ /// Contains all International System of Units constants and definitions.
+ ///
+ public abstract class SIUnit : IUnit
+ {
+
+ }
+}
From 3559e80e0c89dc826a9dc72577370eb07ab7523c Mon Sep 17 00:00:00 2001
From: Don Zhu <85122787+DZ-FSDev@users.noreply.github.com>
Date: Fri, 25 Feb 2022 15:44:17 -0600
Subject: [PATCH 2/3] Skel. Impl. IUnit
---
src/main/cs/SIUnit.cs | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/src/main/cs/SIUnit.cs b/src/main/cs/SIUnit.cs
index 7910309..17d0432 100644
--- a/src/main/cs/SIUnit.cs
+++ b/src/main/cs/SIUnit.cs
@@ -23,6 +23,28 @@ namespace COM.DZ_FSDev.Physics
///
public abstract class SIUnit : IUnit
{
+ public string Name { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
+ public string Symbol { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
+ public int Order { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
+ public bool CanAdd(IUnit unit)
+ {
+ throw new System.NotImplementedException();
+ }
+
+ public IUnit DivideBy(IUnit unit)
+ {
+ throw new System.NotImplementedException();
+ }
+
+ public IUnit MultiplyBy(IUnit unit)
+ {
+ throw new System.NotImplementedException();
+ }
+
+ public IUnit Pow(decimal exponent)
+ {
+ throw new System.NotImplementedException();
+ }
}
}
From 6133c61d216ccd984b33e069258a53efc02c06de Mon Sep 17 00:00:00 2001
From: Don Zhu <85122787+DZ-FSDev@users.noreply.github.com>
Date: Thu, 3 Mar 2022 09:00:01 -0600
Subject: [PATCH 3/3] Update SIUnit.cs
---
src/main/cs/SIUnit.cs | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/src/main/cs/SIUnit.cs b/src/main/cs/SIUnit.cs
index 17d0432..b1d4343 100644
--- a/src/main/cs/SIUnit.cs
+++ b/src/main/cs/SIUnit.cs
@@ -16,6 +16,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
+using System;
+
namespace COM.DZ_FSDev.Physics
{
///
@@ -23,9 +25,29 @@ namespace COM.DZ_FSDev.Physics
///
public abstract class SIUnit : IUnit
{
- public string Name { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
- public string Symbol { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
- public int Order { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
+ private int _order;
+
+ ///
+ /// Gets the name of this SIUnit.
+ ///
+ public string Name { get; }
+
+ ///
+ /// Gets the symbol of this SIUnit
+ ///
+ public string Symbol { get; }
+
+ ///
+ /// Gets the Order of this SIUnit.
+ ///
+ public int Order {
+ get { return _order; }
+ private set
+ {
+ if (value < 0) throw new ArgumentException("Order cannot be zero.","value");
+ _order = value;
+ }
+ }
public bool CanAdd(IUnit unit)
{