Nick Thissen wrote:
Hi Robert. Did this start in the most latest alpha build? Did it work on the first release of this feature?
I may have broken it with the latest update and you may need to change your script. I think at least you need to replace any mention of "IEnumerable" with "IList".
FilterResults
OrderResults
using System;
using System.Linq;
using System.Collections.Generic;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;
using ATVO.ThemeEditor.ThemeModels.DataSets;
using ATVO.ThemesSDK.Data.Results;
using ATVO.ThemesSDK.Ordering;
namespace Scripts
{
public class Test : CustomStandingsDataSet
{
protected override IList<IEntitySessionResult> FilterResults(
ISimulation sim,
IList<IEntitySessionResult> results)
{
// TODO: Filter results
return results;
}
protected override IList<IEntitySessionResult> OrderResults(
ISimulation sim,
IList<IEntitySessionResult> results,
IDataOrder order)
{
// Optional: change the order of the results
// Use the 'order' parameter to order by the selected Data Order
// This is the default implementation; can leave this out
return order.Sort(results);
}
protected override ISessionResult GetSession(ISimulation sim)
{
// Optional: change the session from which you want to pull the results
return sim.Session.Current;
}
}
}
Nick Thissen wrote:This works fine. Will this be the definition of the base functions of the override going forward, or will we need to update it once it goes to Stable branch?
Changing all "IEnumerable" to "IList" seems to work for me. Did you try this? I should update the template, will do that for the next release.using System;
using System.Linq;
using System.Collections.Generic;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;
using ATVO.ThemeEditor.ThemeModels.DataSets;
using ATVO.ThemesSDK.Data.Results;
using ATVO.ThemesSDK.Ordering;
namespace Scripts
{
public class Test : CustomStandingsDataSet
{
protected override IList<IEntitySessionResult> FilterResults(
ISimulation sim,
IList<IEntitySessionResult> results)
{
// TODO: Filter results
return results;
}
protected override IList<IEntitySessionResult> OrderResults(
ISimulation sim,
IList<IEntitySessionResult> results,
IDataOrder order)
{
// Optional: change the order of the results
// Use the 'order' parameter to order by the selected Data Order
// This is the default implementation; can leave this out
return order.Sort(results);
}
protected override ISessionResult GetSession(ISimulation sim)
{
// Optional: change the session from which you want to pull the results
return sim.Session.Current;
}
}
}