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

479 onboarding azim #652

Closed
wants to merge 7 commits into from
Closed

479 onboarding azim #652

wants to merge 7 commits into from

Conversation

azimc
Copy link
Collaborator

@azimc azimc commented Oct 20, 2023

No description provided.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few bad patterns I found which you should check.

Assets/SEE/Controls/MarkAction.cs Outdated Show resolved Hide resolved
Assets/SEE/Controls/MarkAction.cs Outdated Show resolved Hide resolved
Assets/SEE/Game/SceneManipulation/GameNodeMarker.cs Outdated Show resolved Hide resolved
}
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Missing newline at end of file! Files should always end with a single newline character.

Suggested change
}
}

This bad pattern was detected by the following regular expression:

.*

koschke and others added 3 commits October 20, 2023 13:08
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Collaborator

@koschke koschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are several compile errors. Make sure your code compiles before submitting a pull request. That is the least you should do.

namespace SEE.Controls.Actions
{
/// <summary>
/// Action to create a new node for a selected city.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation is wrong. Looks like a copy & paste error.

{
/// <summary>
/// If the user clicks with the mouse hitting a game object representing a graph node,
/// this graph node is a parent to which a new node is created and added as a child.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This documentation is misleading. The term node should refer only to graph nodes or game objects representing graph nodes. Do you mean a marker instead?

GameObject parent = raycastHit.collider.gameObject;
Vector3 position = parent.transform.position;
Vector3 scale = parent.transform.lossyScale;
addedSphere = GameNodeMarker.AddSphere(parent, position: position, worldSpaceScale: scale);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why passing position and scale as parameters? Couldn't GameNodeMarker.AddSphere retrieve these?

addedSphere = GameNodeMarker.AddSphere(parent, position: position, worldSpaceScale: scale);
// addedSphere has the scale and position of Vector3.
// The position at which the parent was hit will be the center point of the addedSphere.
momento = new Momento(parent, position: position, scale: scale);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be memento not momento.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is even a compiler error. Do not check-in code that does not compile!

// The position at which the parent was hit will be the center point of the addedSphere.
momento = new Momento(parent, position: position, scale: scale);
memento.NodeID = addedSphere.name;
new MarkNetAction(parentID: memento.Parent.name, memento.Position, memento.Scale).Execute();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, no need for the position and scale parameters.

return new HashSet<string>
{
memento.Parent.name,
memento.NodeID
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above, a marker is not a node.

namespace SEE.Game.SceneManipulation
{

public static class GameNodeMarker
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation is missing.

public static GameObject NodeMarker(GameObject parent, Vector3 position, Vector3 worldSpaceScale)
{
GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
Vector3 position = parent.transofrm.position;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in transofrm leading to a compile error. Do not check-in code that does not compile!

// Getter size and position of sphere.
float coords = Math.Min(scale.x, scale.y);
Vector3 size = new Vector3(coords, coords, coords);
Vector3 position = new Vector3(position.x, position.y + scale.y, position.z);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work when there is an antenna or any other kind of decoration above the game object. As hinted in the issue description, you should use GetTop().

namespace SEE.Net.Actions
{
/// <summary>
/// This class is responsible for adding a node via network from one client to all others and
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not adding, but marking.

@koschke
Copy link
Collaborator

koschke commented Oct 28, 2023

PR was only for the onboarding task. The onboarding task will not be merged.

@koschke koschke closed this Oct 28, 2023
@koschke koschke deleted the 479-onboarding-azim branch October 28, 2023 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants