Obstacle Component - UQcsse3200/2026-studio-4 GitHub Wiki

First see: Entity Manager Component and Components

The Obstacle Component class is responsible for the creation of all possible obstacle types in the room entity with this component added.

Config

ObstacleConfig[] obstacles contains all obstacle types that will be built. If any new obstacles want to be added, or current obstacles want to be removed, it can be done by adding or removing the obstacles name from the ObstacleConfig.java file.

Usage

once create() is called through a room entity, the whole obstacles list stored will be iterated through checking each obstacle through a switch case, and creating the respective obstacle type through the ObstacleFactory.java file.

If an obstacle is added to the ObstacleConfig.java file, yet not added to the switch case on create() then an IllegalArgumentException will be thrown notifying of which obstacle type is unsupported.