-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from lucasstarsz/logicmanager-and-scene-improv…
…ement # Added SimpleManager for use of FastJ without scenes Related to #11, #20 ## Additions - Added `SimpleManager` -- a LogicManager implementation that does not use scenes - Added `hellofastj` example -- Empty Window ## Breaking Changes - Removed all uses of Scene from InputManager, Keyboard, Mouse - Removed all uses of Scene from BehaviorManager, TagManager - Rename existing examples/example mains ## Other Changes - Added some missing `@Override` annotations
- Loading branch information
Showing
17 changed files
with
361 additions
and
243 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
22 changes: 22 additions & 0 deletions
22
src/example/java/io/github/lucasstarsz/fastj/example/hellofastj/Main.java
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.github.lucasstarsz.fastj.example.hellofastj; | ||
|
||
import io.github.lucasstarsz.fastj.engine.FastJEngine; | ||
import io.github.lucasstarsz.fastj.graphics.Display; | ||
|
||
import io.github.lucasstarsz.fastj.systems.control.SimpleManager; | ||
|
||
public class Main extends SimpleManager { | ||
|
||
@Override | ||
public void init(Display display) { | ||
} | ||
|
||
@Override | ||
public void update(Display display) { | ||
} | ||
|
||
public static void main(String[] args) { | ||
FastJEngine.init("Hello, FastJ!", new Main()); | ||
FastJEngine.run(); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...fastj/example/helloworld/GameManager.java → ...tj/example/oldhelloworld/GameManager.java
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
2 changes: 1 addition & 1 deletion
2
...starsz/fastj/example/helloworld/Main.java → ...rsz/fastj/example/oldhelloworld/Main.java
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
56 changes: 56 additions & 0 deletions
56
src/main/java/io/github/lucasstarsz/fastj/systems/behaviors/BehaviorHandler.java
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package io.github.lucasstarsz.fastj.systems.behaviors; | ||
|
||
import io.github.lucasstarsz.fastj.graphics.game.GameObject; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Interface denoting that the implementing classes directly interface with the {@link BehaviorManager} class. | ||
* | ||
* <b>FOR IMPLEMENTORS:</b> In order for these methods to work you need to call {@link | ||
* BehaviorManager#addListenerList(BehaviorHandler)} upon construction. | ||
*/ | ||
public interface BehaviorHandler { | ||
|
||
/** | ||
* Gets the behavior listeners assigned to the behavior handler. | ||
* | ||
* @return The behavior listeners of the behavior handler. | ||
*/ | ||
default List<GameObject> getBehaviorListeners() { | ||
return BehaviorManager.getList(this); | ||
} | ||
|
||
/** | ||
* Adds the specified behavior listener to the behavior handler. | ||
* | ||
* @param listener The behavior listener to add. | ||
*/ | ||
default void addBehaviorListener(GameObject listener) { | ||
BehaviorManager.addListener(this, listener); | ||
} | ||
|
||
/** | ||
* Removes the specified behavior listener from the behavior handler. | ||
* | ||
* @param listener The behavior listener to remove. | ||
*/ | ||
default void removeBehaviorListener(GameObject listener) { | ||
BehaviorManager.removeListener(this, listener); | ||
} | ||
|
||
/** Initializes all behavior listeners in the behavior handler. */ | ||
default void initBehaviorListeners() { | ||
BehaviorManager.initBehaviorListeners(this); | ||
} | ||
|
||
/** Updates all behavior listeners in the behavior handler. */ | ||
default void updateBehaviorListeners() { | ||
BehaviorManager.updateBehaviorListeners(this); | ||
} | ||
|
||
/** Removes all behavior listeners in the behavior handler. */ | ||
default void clearBehaviorListeners() { | ||
BehaviorManager.clearListenerList(this); | ||
} | ||
} |
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
Oops, something went wrong.