Skip to content

Commit

Permalink
Merge pull request #2 from Folleach/master
Browse files Browse the repository at this point in the history
refactore levellength
  • Loading branch information
flightlex authored Oct 23, 2023
2 parents 90b16cf + 829ac58 commit ccd266f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace GeometryDashAPI.Tests;

[TestFixture]
public class LevelLengthTests
public class LevelDurationTests
{
[TestCase("12034598_Conclusion", 57)]
[TestCase("28755513_TheFinalLair", 154)]
Expand All @@ -19,6 +19,6 @@ public void Test(string fileName, int expectedSeconds)
var responseBody = File.ReadAllText(Path.Combine("data", "levels", fileName));
var response = new ServerResponse<LevelResponse>(HttpStatusCode.OK, responseBody);
var level = new Level(response.GetResultOrDefault().Level.LevelString, compressed: true);
level.LevelLength.TotalSeconds.Should().BeApproximately(expectedSeconds, precision: 1);
level.Duration.TotalSeconds.Should().BeApproximately(expectedSeconds, precision: 1);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using GeometryDashAPI.Attributes;
using GeometryDashAPI.Levels.GameObjects.Default;

namespace GeometryDashAPI.Levels
namespace GeometryDashAPI.Levels.GameObjects.Default
{
public class Portal : Block
{
Expand All @@ -15,4 +14,4 @@ public Portal(int id) : base(id)
{
}
}
}
}
1 change: 1 addition & 0 deletions GeometryDashAPI/Levels/GameObjects/Specific/SpeedBlock.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using GeometryDashAPI.Attributes;
using GeometryDashAPI.Levels.Enums;
using GeometryDashAPI.Levels.GameObjects.Default;

namespace GeometryDashAPI.Levels.GameObjects.Specific
{
Expand Down
2 changes: 1 addition & 1 deletion GeometryDashAPI/Levels/Level.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public Guidelines Guidelines
set => Options.Guidelines = value;
}

public TimeSpan LevelLength => Levels.LevelLength.Measure(this);
public TimeSpan Duration => LevelDuration.Measure(this);

public int CountBlock => Blocks.Count;
public int CountColor => Options.Colors.Count;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace GeometryDashAPI.Levels
{
public static class LevelLength
public static class LevelDuration
{
public static TimeSpan Measure(Level level)
{
Expand Down

0 comments on commit ccd266f

Please sign in to comment.