Skip to content

Scanner Task

Ahmad Abu-Aysha edited this page Sep 10, 2023 · 1 revision

Introduction

The ScannerTask implements scanning behaviour for GapScanner enitities that detect conditions related to engineer spawning.

Scanner Task

The scanner task is added to the gapScanner entity's AITaskComponent during instantiation. It spawns up to 3 engineers at its location if the following conditions are met:

  • No towers exist within detection range in the lane
  • No Engineers exist within detection range in the lane
  • Mobs are detected within detection range in the lane

The functionality will likely be modified/expanded to update the task if engineers die and more are required.

Usage

As with other tasks, this is a task that is added to an entity's AITaskComponent. It requires no arguments. An example of its use is as follows:

Entity scanner = new Entity();

    AITaskComponent aiComponent = new AITaskComponent();

    scanner
            .addComponent(new PhysicsComponent())
            .addComponent(aiComponent);

    scanner.getComponent(AITaskComponent.class).addTask(new ScannerTask());

Sequence Diagram

The integration of the ScannerTask into the GapScanner is shown in the sequence diagram in GapScannerFactory and will not be shown here.

UML Diagram

The integration of the ScannerTask into the GapScanner class structure is shown in the UML diagram in GapScannerFactory and will not be shown here.

Clone this wiki locally