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

Add late-behavior initialization #201

Merged
merged 5 commits into from
May 7, 2022
Merged

Conversation

lucasstarsz
Copy link
Member

Late-Behavior Initialization

Resolves #172

Additions

  • added GameObject#addLateBehavior()

Other Changes

  • updated example usage of late behavior initialization to use addLateBehavior

Example

// game is running -- behavior initialization has already occured

Behavior behavior = Behavior.simpleRotation(1f);

/* old method */

gameObject.addBehavior(behavior, /* your scene/simple manager */);
// behavior we just added has not yet been initialized, so initialize it
behavior.init(gameObject); 


/* new method */

gameObject.addLateBehavior(behavior,  /* your scene/simple manager */);
// behavior is already initialized, we can continue programming!

@sonarcloud
Copy link

sonarcloud bot commented May 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

88.9% 88.9% Coverage
0.0% 0.0% Duplication

@lucasstarsz lucasstarsz merged commit 60dc5a1 into fastjengine:main May 7, 2022
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.

[Feature Request]: Mid-Game init() calls
1 participant