[Alpha 1.32.2.1] Custom Datasets are not overriding the base dataset functions

Posts: 21
Description: Custom Datasets are not overriding the base dataset functions

Steps to reproduce:

1. Have a theme and attempt to create a Custom Dataset Script in C#
2. Notice it gives an error noting that the protected overrides are not able to override due to the base function not being overrideable

Expected behaviour: The base DataSet functions should be overrideable
Posts: 785
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".
Posts: 21
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".

Hi Nick,

It started in the latest Alpha Build. It worked fine on the first release of this feature. I'll look into it for you to see if a change to IList fixes the issue.
Posts: 21
Upon further investigation - it seems that the reason for the issues present is due to the fact the classes no longer exist in the CustomStandingsDataSet class.

Previously on the initial implementation the two classes were the main ones being overriden:

FilterResults
OrderResults




When looking at how the base is overriden, could it be possible to override EntitySessionResultStandingsDataSet in a custom dataset implementation and then be able to give the same result?

- Robert
Edited (1 time)
Posts: 21
Any update on this?
Posts: 785
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;
}
}
}
Posts: 21
Nick Thissen wrote:
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;
        }
}
}

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?
Posts: 785
The change was related to performance improvements. Since it's still in alpha it may change again, although I think it won't change much anymore. I'll try to keep it close to this and will update the templates when it goes to beta or stable.