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.ThemesSDK.Data.Entity;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Controls;
using ATVO.ThemeEditor.Scripting.DotNET;
using ATVO.ThemesSDK.Data.Enums;
using ATVO.ThemesSDK.Data.Results;
namespace Scripts
{
public class Script : IScript
{
int[] PointStructure = new int[] { 0, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
IEntitySessionResult result = (IEntitySessionResult) value;
var pos = result.LivePosition;
int CurrentPoints = PointStructure[pos];
if (result.LivePosition == 0)
{
return "0";
}
//Lap Led Point
if (result.LapsLed > 0)
{
CurrentPoints++;
}
//Pole Position Point
if (result.StartPosition == 1)
{
CurrentPoints++;
}
//Winner Point
if (result.LivePosition == 1)
{
CurrentPoints++;
}
return CurrentPoints;
}
}
}