Skip to content

Gap Scanner Factory

Ahmad Abu-Aysha edited this page Sep 11, 2023 · 5 revisions

Introduction

The Gap scanner factory class creates scanner entities that detect the absence of towers and engineers, and the presence of mobs within approximately half the length of the lane. This triggers spawning of engineers by the attached ScannerTask.

Scanner Entities

Scanner entities have no visual, collider, or hitbox components. They have a PhysicsComponent which allows them to use raycasts for scanning, and an AITaskComponent which allows them to run the ScannerTask. A Single scanner entity is spawned at the far left end of each lane, and remains there for the duration of the game.

Usage

Scanner entities can be instantiated and spawned by

Entity scanner = GapScannerFactory.createScanner();
spawnEntityAt(scanner, <position>, true, true);

Sequence Diagram

The logical flow of GapScanner and ScannerTask are illustrated in the following sequence diagram

EngineerFactoryGapScannerFactorySequenceDiagram

UML Diagram

The class structure of the GapScanner Factory and ScannerTask is shown in the following UML diagram

GapScannerFactory UML

Clone this wiki locally