Warning Factory - UQcsse3200/2023-studio-3 GitHub Wiki
Description
The WarningFactory creates an Entity, adds a WarningComponent and configures it to process a mob. It then adds an AITaskComponent containing the WarningTask, which enables the WarningTask to update and delete the WarningComponent. A Camera object is used to flash size-matched warning signals on incoming mobs.
Functionality
The public static Entity createWarning(Entity mob) creates the WarningComponent, AITaskComponent, WarningTask and adds them to a new Entity which is returned after configuring the mob for the WarningComponent using warningComponent.config(mob);.
The Camera for this class is configured globally using WarningFactory.camera = renderer.getCamera().getCamera(); in the MainGameScreen constructor.