Report post

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.


Post

Posted by Billy R
on
using System;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;

namespace lapspeed.cs
{
public class lapspeed : IScript
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
var result = (IEntitySessionResult)value;
var laptime = result.FastestLapTime;

var trackLength = 2.50f; // Hard-code 2.50 miles

var laptimeHours = laptime / 3600; // Laptime in hours
var speed = trackLength / laptimeHours; // Average speed in mph

return speed + " mph";
}
}
}

that's the code i have in now, which is giving me this error: (Line 12) The type or namespace name 'IEntitySessionResult' could not be found (are you missing a using directive or an assembly reference?)

which in this case is the var result line.