本文整理汇总了C#中Runner.SetSplitTime方法的典型用法代码示例。如果您正苦于以下问题:C# Runner.SetSplitTime方法的具体用法?C# Runner.SetSplitTime怎么用?C# Runner.SetSplitTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Runner
的用法示例。
在下文中一共展示了Runner.SetSplitTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseXmlData
//.........这里部分代码省略.........
}
string status = competitorStatusNode.Attributes["value"].Value;
string time = resultTimeNode.InnerText;
string starttime = startTimeNode.InnerText;
string si = ccCardNode.InnerText;
var dbid = CalculateIDFromSiCard(logit, si, familyname, givenname, pid);
var runner = new Runner(dbid, givenname + " " + familyname, club, className);
if (!string.IsNullOrEmpty(starttime))
{
int istarttime = ParseTime(starttime);
runner.SetStartTime(istarttime);
}
int itime = ParseTime(time);
int istatus = 10;
switch (status)
{
case "MisPunch":
istatus = 3;
break;
case "Disqualified":
istatus = 4;
break;
case "DidNotFinish":
istatus = 3;
itime = -3;
break;
case "DidNotStart":
istatus = 1;
itime = -3;
break;
case "Overtime":
istatus = 5;
break;
case "OK":
istatus = 0;
break;
case "NotCompeting":
//Does not compete, exclude
continue;
}
runner.SetResult(itime, istatus);
var lsplitCodes = new List<int>();
var lsplitTimes = new List<int>();
XmlNodeList splittimes = personNode.SelectNodes("Result/SplitTime");
if (splittimes != null)
{
foreach (XmlNode splitNode in splittimes)
{
XmlNode splitcode = splitNode.SelectSingleNode("ControlCode");
XmlNode splittime = splitNode.SelectSingleNode("Time");
if (splittime == null || splitcode == null)
continue;
int iSplitcode;
string sSplittime = splittime.InnerText;
if (int.TryParse(splitcode.InnerText, out iSplitcode) && sSplittime.Length > 0)
{
if (iSplitcode == 999)
{
if (istatus == 0 && itime == -1)
{
//Målstämpling
itime = ParseTime(sSplittime);
runner.SetResult(itime, 0);
}
}
else
{
iSplitcode += 1000;
while (lsplitCodes.Contains(iSplitcode))
{
iSplitcode += 1000;
}
int iSplittime = ParseTime(sSplittime);
lsplitCodes.Add(iSplitcode);
lsplitTimes.Add(iSplittime);
runner.SetSplitTime(iSplitcode, iSplittime);
}
}
}
}
runners.Add(runner);
}
}
}
return runners.ToArray();
}
示例2: ParseXmlData
//.........这里部分代码省略.........
if (!string.IsNullOrEmpty(starttime))
{
int istarttime = ParseTime(starttime);
runner.SetStartTime(istarttime);
}
int itime = ParseTime(time);
int istatus = 10;
if (status.ToLower() == "notcompeting")
{
//Does not compete, exclude
continue;
}
//runners without starttimenode have not started yet
if (startTimeNode != null)
{
switch (status.ToLower())
{
case "mispunch":
istatus = 3;
break;
case "disqualified":
istatus = 4;
break;
case "didnotfinish":
istatus = 3;
itime = -3;
break;
case "didnotstart":
istatus = 1;
itime = -3;
break;
case "overtime":
istatus = 5;
break;
case "ok":
istatus = 0;
break;
}
}
runner.SetResult(itime, istatus);
var lsplitCodes = new List<int>();
var lsplitTimes = new List<int>();
XmlNodeList splittimes = personNode.SelectNodes("Result/SplitTime");
if (splittimes != null)
{
foreach (XmlNode splitNode in splittimes)
{
XmlNode splitcode = splitNode.SelectSingleNode("ControlCode");
XmlNode splittime = splitNode.SelectSingleNode("Time");
if (splittime == null || splitcode == null)
continue;
int iSplitcode;
string sSplittime = splittime.InnerText;
bool parseOK = int.TryParse(splitcode.InnerText, out iSplitcode);
bool isFinishPunch = splitcode.InnerText.StartsWith("F", StringComparison.InvariantCultureIgnoreCase) || iSplitcode == 999;
if ((parseOK || isFinishPunch) && sSplittime.Length > 0)
{
if (isFinishPunch)
{
if ((istatus == 0 && itime == -1) || (istatus == 10 && itime == -9))
{
//Målstämpling
itime = ParseTime(sSplittime);
runner.SetResult(itime, 0);
}
}
else
{
iSplitcode += 1000;
while (lsplitCodes.Contains(iSplitcode))
{
iSplitcode += 1000;
}
int iSplittime = ParseTime(sSplittime);
lsplitCodes.Add(iSplitcode);
lsplitTimes.Add(iSplittime);
runner.SetSplitTime(iSplitcode, iSplittime);
}
}
}
}
runners.Add(runner);
}
}
}
return runners.ToArray();
}