Skip to content

Commit

Permalink
refactor(Light): Factor Light[Preset] properties into an interface
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Dec 24, 2023
1 parent b5c9b54 commit aa1f65c
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions ZenKit/Vobs/Light.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,27 @@ public enum LightQuality
Low = 2
}

public class LightPreset
public interface ILightPreset
{
public string Preset { get; set; }
public LightType LightType { get; set; }
public float Range { get; set; }
public Color Color { get; set; }
public float ConeAngle { get; set; }
public bool LightStatic { get; set; }
public LightQuality Quality { get; set; }
public string LensflareFx { get; set; }
public bool On { get; set; }
public List<float> RangeAnimationScale { get; set; }
public float RangeAnimationFps { get; set; }
public bool RangeAnimationSmooth { get; set; }
public List<Color> ColorAnimationList { get; set; }
public float ColorAnimationFps { get; set; }
public bool ColorAnimationSmooth { get; set; }
public bool CanMove { get; set; }
}

public class LightPreset : ILightPreset
{
private readonly bool _delete = true;
private readonly UIntPtr _handle;
Expand Down Expand Up @@ -101,7 +121,7 @@ public bool On
set => Native.ZkLightPreset_setOn(_handle, value);
}

public IReadOnlyList<float> RangeAnimationScale
public List<float> RangeAnimationScale
{
get =>
Native.ZkLightPreset_getRangeAnimationScale(_handle, out var count)
Expand Down Expand Up @@ -156,7 +176,7 @@ public bool CanMove
}
}

public class Light : VirtualObject
public class Light : VirtualObject, ILightPreset
{
public Light(Read buf, GameVersion version) : base(Native.ZkLight_load(buf.Handle, version), true)
{
Expand Down

0 comments on commit aa1f65c

Please sign in to comment.