From 0d8da15b753547c2104cc326222e16eb9d26b270 Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Thu, 11 Mar 2021 21:08:56 +0100 Subject: [PATCH 1/3] Update README.md --- README.md | 172 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 171 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b41acd9..5a91002 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,172 @@ # Stone_Red-C-Sharp-Utilities - + +> Adds useful extentions. + +## Install +Currently, only guild members with administrator rights can use this bot. + +## Namespaces +### Stone_Red_Utilities.ArrListExtentions +#### Methods: + * Print + * Parameters: `this Array array`, `char delimiter`, `bool printToDebugConsole` + * Example usage: + ```cs + string[] yourArray = { "str1", "str2", "str3" }; + yourArray.Print(';'); + ``` + * Output: + ``` + str1; str2; str3 + ``` + * Print\ + * Parameters: `this List list`, `char delimiter`, `bool printToDebugConsole` + * Example usage: + ```cs + List yourList = new() { 1.45, 6.24, 4.14 }; + yourList.Print(';'); + ``` + * Output: + ``` + 1.45; 6.24; 4.14 + ``` + * PrintTable\ + * Parameters: `this T[,] array`, `TableStyle tableStyle` + * Example usage: + ```cs + int[,] your2dArray = + { + {1,2,3 }, + {4,5,6 }, + {7,8,9 } + }; + your2dArray.PrintTable(); + ``` + * Output: + ``` + ------------- + | 1 | 2 | 3 | + ------------- + | 4 | 5 | 6 | + ------------- + | 7 | 8 | 9 | + ------------- + ``` + +### Stone_Red_Utilities.ColorConsole +#### Methods: + * Write + * Parameters: `object value`, `ConsoleColor color` + * Example usage: + ```cs + ConsoleExt.Write("text in red", ConsoleColor.Red); + ``` + * Output: + ``` + text in red + ``` + (Imagine that the text is actually red) + * WriteLine + * Parameters: `object value`, `ConsoleColor color` + * Example usage: + ```cs + ConsoleExt.WriteLine("text in green", ConsoleColor.Green); + ``` + * Output: + ``` + text in red + + ``` + (Imagine that the text is actually green) + +### Stone_Red_Utilities.BoolExtentions +#### Methods: + * OneWayTrue + * Parameters: `this ref bool bol`, `bool bol1` + * Example usage: + ```cs + bool bol = false; + + bol.OneWayTrue(false); + Console.WriteLine(bol); + + bol.OneWayTrue(true); + Console.WriteLine(bol); + + bol.OneWayTrue(false); + Console.WriteLine(bol); + ``` + * Output: + ``` + False + True + True + ``` + * OneWayFalse + * Parameters: `this ref bool bol`, `bool bol1` + * Example usage: + ```cs + bool bol = true; + + bol.OneWayFalse(true); + Console.WriteLine(bol); + + bol.OneWayFalse(false); + Console.WriteLine(bol); + + bol.OneWayFalse(true); + Console.WriteLine(bol); + ``` + * Output: + ``` + True + False + False + ``` +### Stone_Red_Utilities.StringExtentions +#### Methods: + * EqualsIgnoreCase + * Parameters: `this string str`, `string value` + * Example usage: + ```cs + string str1 = "BIG"; + string str2 = "big"; + + bool match = str1.EqualsIgnoreCase(str2); + + Console.WriteLine(match); + ``` + * Output: + ``` + True + ``` + * EqualsIgnoreSpaces + * Parameters: `this string str`, `string value` + * Example usage: + ```cs + string str1 = "space"; + string str2 = " s p a c e "; + + bool match = str1.EqualsIgnoreSpaces(str2); + + Console.WriteLine(match); + ``` + * Output: + ``` + True + ``` + * EqualsIgnoreSpacesAndCase + * Parameters: `this string str`, `string value` + * Example usage: + ```cs + string str1 = "BIG space"; + string str2 = "big s p a c e "; + + bool match = str1.EqualsIgnoreSpacesAndCase(str2); + + Console.WriteLine(match); + ``` + * Output: + ``` + True + ``` From 2cdbe4b49493da7a63fe4eb64dc1aa37ee1b3d4f Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Thu, 11 Mar 2021 22:47:26 +0100 Subject: [PATCH 2/3] Update README.md --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5a91002..b1d3e00 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Currently, only guild members with administrator rights can use this bot. ### Stone_Red_Utilities.ArrListExtentions #### Methods: * Print + * Description: Prints items of array not * Parameters: `this Array array`, `char delimiter`, `bool printToDebugConsole` * Example usage: ```cs @@ -20,6 +21,7 @@ Currently, only guild members with administrator rights can use this bot. str1; str2; str3 ``` * Print\ + * Description: Prints items of list * Parameters: `this List list`, `char delimiter`, `bool printToDebugConsole` * Example usage: ```cs @@ -31,6 +33,7 @@ Currently, only guild members with administrator rights can use this bot. 1.45; 6.24; 4.14 ``` * PrintTable\ + * Description: Creates and prints table from 2D array * Parameters: `this T[,] array`, `TableStyle tableStyle` * Example usage: ```cs @@ -56,6 +59,7 @@ Currently, only guild members with administrator rights can use this bot. ### Stone_Red_Utilities.ColorConsole #### Methods: * Write + * Description: Writes the text representation of the specified object to the standard output stream. * Parameters: `object value`, `ConsoleColor color` * Example usage: ```cs @@ -67,6 +71,7 @@ Currently, only guild members with administrator rights can use this bot. ``` (Imagine that the text is actually red) * WriteLine + * Description: Writes the text representation of the specified object, followed by the current line terminator, to the standard output stream. * Parameters: `object value`, `ConsoleColor color` * Example usage: ```cs @@ -82,7 +87,8 @@ Currently, only guild members with administrator rights can use this bot. ### Stone_Red_Utilities.BoolExtentions #### Methods: * OneWayTrue - * Parameters: `this ref bool bol`, `bool bol1` + * Description: Sets value to true if input is true. If input is false the value will not change. + * Parameters: `this ref bool bol`, `bool input` * Example usage: ```cs bool bol = false; @@ -103,7 +109,8 @@ Currently, only guild members with administrator rights can use this bot. True ``` * OneWayFalse - * Parameters: `this ref bool bol`, `bool bol1` + * Description: Sets value to false if input is false. If input is true the value will not change. + * Parameters: `this ref bool bol`, `bool input` * Example usage: ```cs bool bol = true; @@ -126,6 +133,7 @@ Currently, only guild members with administrator rights can use this bot. ### Stone_Red_Utilities.StringExtentions #### Methods: * EqualsIgnoreCase + * Description: Determines whether this instance and another specified object have the same value regardless of upper and lower case. * Parameters: `this string str`, `string value` * Example usage: ```cs @@ -141,6 +149,7 @@ Currently, only guild members with administrator rights can use this bot. True ``` * EqualsIgnoreSpaces + * Description: Determines whether this instance and another specified object have the same value regardless of spaces. * Parameters: `this string str`, `string value` * Example usage: ```cs @@ -156,6 +165,7 @@ Currently, only guild members with administrator rights can use this bot. True ``` * EqualsIgnoreSpacesAndCase + * Description: Determines whether this instance and another specified object have the same value regardless of upper and lower case and spaces. * Parameters: `this string str`, `string value` * Example usage: ```cs From c63039004f7d8c34a0fd40bce1fbb32940ac0280 Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Thu, 11 Mar 2021 22:49:01 +0100 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b1d3e00..a634fa1 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Currently, only guild members with administrator rights can use this bot. {4,5,6 }, {7,8,9 } }; - your2dArray.PrintTable(); + your2dArray.PrintTable(TableStyle.Default); ``` * Output: ```