Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ParseTime()

bool System.Globalization.TimeSpanParse.StringParser.ParseTime ( out long time,
ref TimeSpanResult result )
inlinepackage

Definition at line 626 of file TimeSpanParse.cs.

627 {
628 time = 0L;
629 if (!ParseInt(23, out var i, ref result))
630 {
631 return false;
632 }
633 time = i * 36000000000L;
634 if (_ch != ':')
635 {
636 return result.SetBadTimeSpanFailure();
637 }
638 NextChar();
639 if (!ParseInt(59, out i, ref result))
640 {
641 return false;
642 }
643 time += (long)i * 600000000L;
644 if (_ch == ':')
645 {
646 NextChar();
647 if (_ch != '.')
648 {
649 if (!ParseInt(59, out i, ref result))
650 {
651 return false;
652 }
653 time += (long)i * 10000000L;
654 }
655 if (_ch == '.')
656 {
657 NextChar();
658 int num = 10000000;
659 while (num > 1 && _ch >= '0' && _ch <= '9')
660 {
661 num /= 10;
662 time += (_ch - 48) * num;
663 NextChar();
664 }
665 }
666 }
667 return true;
668 }
bool ParseInt(int max, out int i, ref TimeSpanResult result)

References System.Globalization.TimeSpanParse.StringParser._ch, System.L, System.Globalization.TimeSpanParse.StringParser.NextChar(), and System.Globalization.TimeSpanParse.StringParser.ParseInt().

Referenced by System.Globalization.TimeSpanParse.StringParser.TryParse().