Skip to content

Commit

Permalink
add hsv values for block #35
Browse files Browse the repository at this point in the history
  • Loading branch information
Folleach committed Dec 30, 2023
1 parent 66bed70 commit 69f58cd
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 23 deletions.
34 changes: 34 additions & 0 deletions GeometryDashAPI/Levels/GameObjects/Default/Block.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,40 @@ public Layer ZLayer
[GameProperty("32", 1f)] public float Scale { get; set; } = 1f;
[GameProperty("34", false)] public bool GroupParent { get; set; }

[GameProperty("43", null)]
private Hsv? hsv;

[GameProperty("44", null)]
private Hsv? additionalHsv;

[GameProperty("41", false)]
public bool HasHsv { get; protected set; }

[GameProperty("42", false)]
public bool HasAdditionalHsv { get; protected set; }

/// <inheritdoc />
public Hsv? Hsv
{
get => hsv;
set
{
hsv = value;
HasHsv = value != null;
}
}

/// <inheritdoc />
public Hsv? AdditionalHsv
{
get => additionalHsv;
set
{
additionalHsv = value;
HasAdditionalHsv = value != null;
}
}

public Block()
{
}
Expand Down
61 changes: 38 additions & 23 deletions GeometryDashAPI/Levels/GameObjects/IBlock.cs
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
using GeometryDashAPI.Levels.Enums;

namespace GeometryDashAPI.Levels.GameObjects
namespace GeometryDashAPI.Levels.GameObjects;

public interface IBlock : IGameObject
{
public interface IBlock : IGameObject
{
int Id { get; set; }
float PositionX { get; set; }
float PositionY { get; set; }
bool HorizontalReflection { get; set; }
bool VerticalReflection { get; set; }
int Rotation { get; set; }
bool Glow { get; set; }
int LinkControl { get; set; }
short EditorL { get; set; }
short EditorL2 { get; set; }
bool HighDetail { get; set; }
int[] Groups { get; set; }
bool DontFade { get; set; }
bool DontEnter { get; set; }
int ZOrder { get; set; }
Layer ZLayer { get; set; }
float Scale { get; set; }
bool GroupParent { get; set; }
bool IsTrigger { get; set; }
}
int Id { get; set; }
float PositionX { get; set; }
float PositionY { get; set; }
bool HorizontalReflection { get; set; }
bool VerticalReflection { get; set; }
int Rotation { get; set; }
bool Glow { get; set; }
int LinkControl { get; set; }
short EditorL { get; set; }
short EditorL2 { get; set; }
bool HighDetail { get; set; }
int[] Groups { get; set; }
bool DontFade { get; set; }
bool DontEnter { get; set; }
int ZOrder { get; set; }
Layer ZLayer { get; set; }
float Scale { get; set; }
bool GroupParent { get; set; }
bool IsTrigger { get; set; }

bool HasHsv { get; }
bool HasAdditionalHsv { get; }

/// <summary>
/// If block has 1 color: <b>base</b> or <b>detail</b><br/>
/// The <see cref="Hsv"/> value takes either <b>base</b> or <b>detail</b><br/><br/>
/// If block has 2 colors, <see cref="Hsv"/> is <b>base</b>
/// </summary>
Hsv? Hsv { get; set; }

/// <summary>
/// If block has 2 colors: <b>base</b> and <b>detail</b><br/>
/// <see cref="AdditionalHsv"/> is detail, otherwise null
/// </summary>
Hsv? AdditionalHsv { get; set; }
}

0 comments on commit 69f58cd

Please sign in to comment.