mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-12 21:38:38 +00:00
Added layers backend skeleton code
This commit is contained in:
parent
266390975d
commit
0029a1b99e
@ -190,6 +190,10 @@
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Linq.Dynamic, Version=1.0.5840.25917, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Linq.Dynamic.1.0.6\lib\net40\System.Linq.Dynamic.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
@ -249,6 +253,9 @@
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ArtemisBootstrapper.cs" />
|
||||
<Compile Include="Components\Abstract\LayerComponent.cs" />
|
||||
<Compile Include="Components\Layer.cs" />
|
||||
<Compile Include="Components\LayerComposite.cs" />
|
||||
<Compile Include="Events\ToggleEnabled.cs" />
|
||||
<Compile Include="Events\ActiveEffectChanged.cs" />
|
||||
<Compile Include="Events\ChangeBitmap.cs" />
|
||||
@ -269,6 +276,8 @@
|
||||
<Compile Include="Models\EffectModel.cs" />
|
||||
<Compile Include="Models\EffectSettings.cs" />
|
||||
<Compile Include="Models\GameSettings.cs" />
|
||||
<Compile Include="Models\Interfaces\IGameDataModel.cs" />
|
||||
<Compile Include="Models\LayerConditionModel.cs" />
|
||||
<Compile Include="Modules\Effects\AmbientLightning\AmbientLightningEffectModel.cs" />
|
||||
<Compile Include="Modules\Effects\AmbientLightning\AmbientLightningEffectSettings.cs" />
|
||||
<Compile Include="Modules\Effects\AmbientLightning\AmbientLightningEffectView.xaml.cs">
|
||||
|
||||
21
Artemis/Artemis/Components/Abstract/LayerComponent.cs
Normal file
21
Artemis/Artemis/Components/Abstract/LayerComponent.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using Artemis.Models;
|
||||
using Artemis.Models.Interfaces;
|
||||
|
||||
namespace Artemis.Components.Abstract
|
||||
{
|
||||
public abstract class LayerComponent
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public List<LayerConditionModel> ConditionModels { get; set; }
|
||||
|
||||
public bool ConditionsMet(IGameDataModel dataModel)
|
||||
{
|
||||
return ConditionModels.All(cm => cm.ConditionMet(dataModel));
|
||||
}
|
||||
|
||||
public abstract void Draw(Graphics g);
|
||||
}
|
||||
}
|
||||
13
Artemis/Artemis/Components/Layer.cs
Normal file
13
Artemis/Artemis/Components/Layer.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System.Drawing;
|
||||
using Artemis.Components.Abstract;
|
||||
|
||||
namespace Artemis.Components
|
||||
{
|
||||
public class Layer : LayerComponent
|
||||
{
|
||||
public override void Draw(Graphics g)
|
||||
{
|
||||
// Read properties and draw accordingly
|
||||
}
|
||||
}
|
||||
}
|
||||
17
Artemis/Artemis/Components/LayerComposite.cs
Normal file
17
Artemis/Artemis/Components/LayerComposite.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using Artemis.Components.Abstract;
|
||||
|
||||
namespace Artemis.Components
|
||||
{
|
||||
public class LayerComposite : LayerComponent
|
||||
{
|
||||
public List<LayerComponent> LayerComponents { get; set; }
|
||||
|
||||
public override void Draw(Graphics g)
|
||||
{
|
||||
foreach (var layerComponent in LayerComponents)
|
||||
layerComponent.Draw(g);
|
||||
}
|
||||
}
|
||||
}
|
||||
6
Artemis/Artemis/Models/Interfaces/IGameDataModel.cs
Normal file
6
Artemis/Artemis/Models/Interfaces/IGameDataModel.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace Artemis.Models.Interfaces
|
||||
{
|
||||
public interface IGameDataModel
|
||||
{
|
||||
}
|
||||
}
|
||||
20
Artemis/Artemis/Models/LayerConditionModel.cs
Normal file
20
Artemis/Artemis/Models/LayerConditionModel.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Dynamic;
|
||||
|
||||
namespace Artemis.Models
|
||||
{
|
||||
public class LayerConditionModel
|
||||
{
|
||||
public string Field { get; set; }
|
||||
public string Value { get; set; }
|
||||
public string Operator { get; set; }
|
||||
|
||||
public bool ConditionMet(object subject)
|
||||
{
|
||||
// Put the subject in a list, allowing Dynamic Linq to be used.
|
||||
var subjectList = new List<object> {subject};
|
||||
var res = subjectList.Where($"s => s.{Field} {Operator} {Value}").Any();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using Artemis.Models.Interfaces;
|
||||
|
||||
namespace Artemis.Modules.Games.TheDivision
|
||||
{
|
||||
public class TheDivisionDataModel
|
||||
public class TheDivisionDataModel : IGameDataModel
|
||||
{
|
||||
public List<DivisionPlayer> DivisionPlayers { get; set; }
|
||||
public GrenadeState GrenadeState { get; set; }
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
<package id="SharpDX" version="3.0.2" targetFramework="net452" />
|
||||
<package id="SharpDX.Direct3D11" version="3.0.2" targetFramework="net452" />
|
||||
<package id="SharpDX.DXGI" version="3.0.2" targetFramework="net452" />
|
||||
<package id="System.Linq.Dynamic" version="1.0.6" targetFramework="net452" />
|
||||
<package id="VirtualInput" version="1.0.1" targetFramework="net452" />
|
||||
<package id="WpfExceptionViewer" version="1.0.0.0" targetFramework="net452" />
|
||||
</packages>
|
||||
Loading…
x
Reference in New Issue
Block a user