🎨 Add methods to create explicit and implicit trust values
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / freenet / wot / Trust.kt
index aa6b04e..f54cfc3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - Trust.kt - Copyright Â© 2010–2019 David Roden
+ * Sone - Trust.kt - Copyright Â© 2010–2020 David Roden
  *
  * 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
@@ -21,3 +21,6 @@ package net.pterodactylus.sone.freenet.wot
  * Container class for trust in the web of trust.
  */
 data class Trust(val explicit: Int?, val implicit: Int?, val distance: Int?)
+
+fun trustExplicitely(value: Int) = Trust(explicit = value, implicit = null, distance = 1)
+fun trustImplicitely(value: Int, distance: Int = 2) = Trust(explicit = null, implicit = value, distance)