Are you sure you want to report the post shown below? This will send an email to the ATVO administrators. Please include a short reason for reporting.
Users reporting for no reason may be locked out.
using System;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;
using ATVO.ThemesSDK.Data.Results;
using ATVO.ThemesSDK.Data.Lap;
namespace Scripts
{
public class Script : IScript
{
public object Execute(ThemeContentItem item,
object value,
string parameter,
ISimulation sim)
{
IEntitySessionResult result = (IEntitySessionResult) value;
if (result != null)
{
if (result.ClassPosition == 1)
{
var number = (ILap) result.Laps;
var lapnum = number.Number;
string str = lapnum.ToString(); //This returns a strange output, not the lap number.
return ("Lap " + str);
}
else
{
string outputStr = "DNF";
if(result.ClassGap > 0)
{
outputStr = "+" + result.ClassGap.ToString("0.000");
}
return outputStr;
}
}
else
return null;
}
}
}