mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Add clone function to MaterialValueManager.
This commit is contained in:
parent
eea4de63d5
commit
994b7bfb6c
1 changed files with 9 additions and 1 deletions
|
|
@ -1,10 +1,11 @@
|
|||
global using StateMaterialManager = Glamourer.Interop.Material.MaterialValueManager<Glamourer.Interop.Material.MaterialValueState>;
|
||||
global using DesignMaterialManager = Glamourer.Interop.Material.MaterialValueManager<System.Numerics.Vector3>;
|
||||
global using DesignMaterialManager = Glamourer.Interop.Material.MaterialValueManager<Glamourer.Interop.Material.MaterialValueDesign>;
|
||||
using Glamourer.State;
|
||||
|
||||
|
||||
namespace Glamourer.Interop.Material;
|
||||
|
||||
public record struct MaterialValueDesign(Vector3 Value, bool Enabled);
|
||||
public record struct MaterialValueState(Vector3 Game, Vector3 Model, StateSource Source);
|
||||
|
||||
public readonly struct MaterialValueManager<T>
|
||||
|
|
@ -17,6 +18,13 @@ public readonly struct MaterialValueManager<T>
|
|||
public void Clear()
|
||||
=> _values.Clear();
|
||||
|
||||
public MaterialValueManager<T> Clone()
|
||||
{
|
||||
var ret = new MaterialValueManager<T>();
|
||||
ret._values.AddRange(_values);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public bool TryGetValue(MaterialValueIndex index, out T value)
|
||||
{
|
||||
if (_values.Count == 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue