Wycademy/src/Wycademy/Commands/Services/MotionValueService.cs
/// <summary>
/// Gets the motion values for a weapon.
/// </summary>
/// <param name="weaponName">The weapon's name, either in its shortened form or all lowercase, with words separated by hyphens.</param>
/// <returns>A tuple, with text being the code block(s) and splitPoint being the substring length, if applicable.</returns>
Gets the motion values for a weapon.
Gets the motion values for a weapon .
public (string text, int? splitPoint) GetMotionValues(string weaponName)
        {
            string filePath = Path.Combine(WycademyConst.DATA_LOCATION, "gen", "mv", $"{AliasWeaponNames(weaponName)}.txt");
            int? point = null;
            bool split = false;
            var builder = new StringBuilder("```");
            foreach (var line in File.ReadAllLines(filePath, new UTF8Encoding(false)))
            {
                if (builder.Length + line.Length >= 1994 && !split)
                {
                    split = true;
                    builder.Append("```");
                    point = builder.Length;
                    builder.Append("```");
                }
                builder.AppendLine(line);
            }
            builder.AppendLine("```");
            return (builder.ToString(), point);
        }
public ( string text , int ? splitPoint ) GetMotionValues ( string weaponName ) { string filePath = Path . Combine ( WycademyConst . DATA_LOCATION , " " , " " , $" { AliasWeaponNames ( weaponName ) } .txt " ) ; int ? point = null ; bool split = false ; var builder = new StringBuilder ( " " ) ; foreach ( var line in File . ReadAllLines ( filePath , new UTF8Encoding ( false ) ) ) { if ( builder . Length + line . Length >= 1994 && ! split ) { split = true ; builder . Append ( " " ) ; point = builder . Length ; builder . Append ( " " ) ; } builder . AppendLine ( line ) ; } builder . AppendLine ( " " ) ; return ( builder . ToString ( ) , point ) ; }
Gets the motion values for a weapon.
Gets the motion values for a weapon .
// 2000 - (```) x 2 // Close the first code block. // Open the second code block.
A tuple, with text being the code block(s) and splitPoint being the substring length, if applicable.
A tuple with text being the code block ( s ) and splitPoint being the substring length if applicable .
weaponName
string
The weapon's name, either in its shortened form or all lowercase, with words separated by hyphens.
The weapon ' s name either in its shortened form or all lowercase with words separated by hyphens .