Data model debug - Added semi support for lists

This commit is contained in:
Robert committed 2020-06-29 17:29:47 +02:00
1 parent 98ec26304a
commit 40eda4fc2b
11 files changed
+210 -74

No files matched your search

@@ -1,4 +1,5 @@
using Artemis.Core.Plugins.Abstract.DataModels;
using System.Collections.Generic;
using Artemis.Core.Plugins.Abstract.DataModels;
using Artemis.Core.Plugins.Abstract.DataModels.Attributes;
using SkiaSharp;
@@ -9,6 +10,8 @@ namespace Artemis.Plugins.Modules.General
public GeneralDataModel()
{
PlayerInfo = new PlayerInfo();
IntsList = new List<int>();
PlayerInfosList = new List<PlayerInfo>();
}
[DataModelProperty(Name = "A test string", Description = "This is a test string that's not of any use outside testing!")]
@@ -21,6 +24,9 @@ namespace Artemis.Plugins.Modules.General
public PlayerInfo PlayerInfo { get; set; }
public double UpdatesDividedByFour { get; set; }
public List<int> IntsList { get; set; }
public List<PlayerInfo> PlayerInfosList { get; set; }
}
public class PlayerInfo : DataModel
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Abstract.DataModels;
using Artemis.Core.Plugins.Abstract.ViewModels;
using Artemis.Core.Plugins.Models;
using Artemis.Plugins.Modules.General.ViewModels;
@@ -12,7 +11,7 @@ namespace Artemis.Plugins.Modules.General
public class GeneralModule : ProfileModule<GeneralDataModel>
{
private readonly PluginSettings _settings;
private Random _rand;
private readonly Random _rand;
public GeneralModule(PluginSettings settings)
{
@@ -29,6 +28,9 @@ namespace Artemis.Plugins.Modules.General
{
DataModel.UpdatesDividedByFour += 0.25;
DataModel.PlayerInfo.Position = new SKPoint(_rand.Next(100), _rand.Next(100));
DataModel.IntsList[0] = _rand.Next();
DataModel.IntsList[2] = _rand.Next();
}
public override void EnablePlugin()
@@ -37,6 +39,8 @@ namespace Artemis.Plugins.Modules.General
DisplayIcon = "AllInclusive";
ExpandsDataModel = true;
DataModel.IntsList = new List<int> {_rand.Next(), _rand.Next(), _rand.Next()};
DataModel.PlayerInfosList = new List<PlayerInfo> {new PlayerInfo()};
var testSetting = _settings.GetSetting("TestSetting", DateTime.Now);
}