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

Snap to grid for opponent unit #26

Closed
wants to merge 0 commits into from
Closed

Conversation

keith-gan
Copy link
Contributor

No description provided.

Copy link
Contributor

@Vanessamae23 Vanessamae23 left a comment

Choose a reason for hiding this comment

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

I am not too sure about having a delegate in a component? cos from my understanding
Components in ECS are typically designed to hold data, representing some aspect or property of an entity in the system. Delegates or function references represent behavior or logic, which is typically handled by systems in ECS.

But i am not too sure also

Copy link
Contributor

@Vanessamae23 Vanessamae23 left a comment

Choose a reason for hiding this comment

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

I am not too sure about having a delegate in a component? cos from my understanding
Components in ECS are typically designed to hold data, representing some aspect or property of an entity in the system. Delegates or function references represent behavior or logic, which is typically handled by systems in ECS.

But i am not too sure also

Copy link
Contributor

@zheng-ze zheng-ze left a comment

Choose a reason for hiding this comment

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

Looks fine but I have a suggestion that you can possibly look into.

Comment on lines 11 to 14
protocol AiSpawnDelegate: AnyObject {
func spawnAiUnit<T: TFEntity & PlayerSpawnable>(ofType type: T.Type, position: CGPoint)
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm maybe it is better to add a delegate for snapping into grid position so that anyone that needs to spawn anything is able to normalise their position? Possibly add the normalisation delegate in the attemptSpawn method that I have added in HomeSystem?

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.

3 participants