Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some instances of the code setting a node's name #34

Merged
merged 4 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
remove uses of GetHashCode()
  • Loading branch information
UTheCat committed Apr 18, 2024
commit 994c295a71cfc5edefcdf6fdeecf4221eaeb5146
2 changes: 1 addition & 1 deletion src/Game/Levels/UserLevelRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public partial class UserLevelRunner : LevelRunner, IDisposable

public UserLevelRunner(Player player, LevelTimer levelTimerOperator) : base(player)
{
Name = $"{nameof(UserLevelRunner)}_{GetHashCode()}";
Name = nameof(UserLevelRunner);

LevelTimerOperator = levelTimerOperator;
SetProcess(true);
Expand Down
2 changes: 1 addition & 1 deletion src/Game/MeshSpinner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public partial class MeshSpinner : Node

public MeshSpinner(MeshInstance3D newMesh, double newRadiansPerSecond)
{
Name = $"MeshSpinner@{GetHashCode()}";
Name = nameof(MeshSpinner);
mesh = newMesh;
radiansPerSecond = newRadiansPerSecond;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Game/Testing/RaycastSweepTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public partial class RaycastSweepTest: Node
/// <param name="node">The Node3D to use the raycast sweep for</param>
public RaycastSweepTest(RaycastSweep raycastSweep, Node3D node, RaycastSweep.SweepOrder sweepOrder)
{
Name = $"{nameof(RaycastSweepTest)}_{GetHashCode()}";
Name = nameof(RaycastSweepTest);

RaycastResultLabel = new Label();
RaycastResultLabel.Name = $"RaycastSweepResultLabel_{GetHashCode()}";
RaycastResultLabel.Name = "RaycastSweepResultLabel";

TestRaycastSweep = raycastSweep;
SweepOrder = sweepOrder;
Expand Down
2 changes: 1 addition & 1 deletion src/core/Levels/Interactives/Interactive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Interactive(OffsetStopwatch clock)
{
IsInitialized = false;
Clock = clock;
Name = $"{nameof(Interactive)}_{GetHashCode()}";
Name = nameof(Interactive);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/core/Levels/LevelRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public partial class LevelRunner : Node
/// <param name="player">The player instance to run this level runner under</param>
public LevelRunner(Player player)
{
Name = $"{nameof(LevelRunner)}_{GetHashCode()}";
Name = nameof(LevelRunner);

CurrentPlayer = player;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/Music/MusicGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public MusicGroup(Node node)
ActualNode = node;
MusicListNode = node.GetNode(MUSIC_LIST_NODE_NAME);

Name = nameof(MusicGroup) + "Handler@" + GetHashCode();
Name = $"{nameof(MusicGroup)}_Handler";
node.AddChild(this);

// Add the song packages
Expand Down
2 changes: 1 addition & 1 deletion src/core/Music/MusicZonePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public partial class MusicZonePlayer : MusicPlayer, IDisposable

public MusicZonePlayer() : base()
{
Name = nameof(MusicZonePlayer) + "@" + GetHashCode();
Name = nameof(MusicZonePlayer);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/core/Players/Controls/FullscreenControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public bool FullscreenEnabled
/// <param name="enabled">Whether or not fullscreen is initially enabled</param>
public FullscreenControl(bool enabled)
{
Name = $"{nameof(FullscreenControl)}@{GetHashCode()}";
Name = nameof(FullscreenControl);
FullscreenEnabled = enabled;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/Players/Controls/RenderFramerateLimiter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public bool IsRunning
public RenderFramerateLimiter()
{
SetProcess(false);
Name = $"{nameof(RenderFramerateLimiter)}@{GetHashCode()}";
Name = nameof(RenderFramerateLimiter);
}

/// <summary>
Expand Down
3 changes: 1 addition & 2 deletions src/core/Players/Movement/Climber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,9 @@ public CollisionShape3D Hitbox
/// </summary>
public Climber(CollisionShape3D hitbox)
{
Name = $"{nameof(Climber)}_{GetHashCode()}";
Name = nameof(Climber);

area = new Area3D();
area.Name = $"{nameof(Climber)}_{GetHashCode()}_{nameof(area)}";

areaBox = new BoxShape3D();

Expand Down
2 changes: 1 addition & 1 deletion src/core/Players/Movement/RotationLockControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public bool UserEnabledShiftLock
/// <param name="camera">The camera to associate with</param>
public RotationLockControl(BaseMover mover, BaseCamera camera)
{
Name = $"{nameof(RotationLockControl)}@{GetHashCode()}";
Name = nameof(RotationLockControl);
UserEnabledShiftLock = false;
Mover = mover;
Camera = camera;
Expand Down
2 changes: 1 addition & 1 deletion src/core/Raycasting/RaycastSweep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public enum SweepOrder
/// <param name="endPosition"></param>
public RaycastSweep(int numRaycasts, Vector3 startPosition, Vector3 endPosition, float raycastLength)
{
Name = $"{nameof(RaycastSweep)}_{GetHashCode()}";
Name = nameof(RaycastSweep);

NumRaycasts = numRaycasts;
StartPosition = startPosition;
Expand Down