-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert points back to non Vogen type for now. Fix bug where speeds we…
…re wrong (should've been 1f instead of .100f)
- Loading branch information
Showing
4 changed files
with
74 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
using Vogen; | ||
namespace PacMan.GameComponents.Primitives; | ||
|
||
namespace PacMan.GameComponents.Primitives; | ||
|
||
[ValueObject<int>(toPrimitiveCasting: CastOperator.Implicit)] | ||
public partial struct Score | ||
public record struct Score(int Value) | ||
{ | ||
[Pure] | ||
public Score IncreaseBy(Points points) => From(Value + points.Value); | ||
public void IncreaseBy(Points points) => Value += points.Value; | ||
|
||
public static readonly Score Zero = new(0); | ||
|
||
public static implicit operator int(Score score) => score.Value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters