From f484f96c89f3d99b53e538fe2785752edba5013c Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Thu, 16 Mar 2023 15:56:33 +0100 Subject: [PATCH] Delete Unit.ts --- .../aic/aicformationdescriptorsection/Unit.ts | 83 ------------------- 1 file changed, 83 deletions(-) delete mode 100644 client/src/aic/aicformationdescriptorsection/Unit.ts diff --git a/client/src/aic/aicformationdescriptorsection/Unit.ts b/client/src/aic/aicformationdescriptorsection/Unit.ts deleted file mode 100644 index 749fe625..00000000 --- a/client/src/aic/aicformationdescriptorsection/Unit.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { AICFormation } from "../aicformation"; -import { AICFormationContextDataInterface } from "../aicformationdescriptor"; -import { AICFormationDescriptorSection } from "../aicformationdescriptorsection"; -import { AICFormationDescriptorComponent } from "../aicformationdescriptorcomponent"; -import { AICFormationDescriptorPhrase } from "../aicformationdescriptorphrase"; - -interface addUnitInformationInterface { - omitTrack?: boolean -} - -export class AICFormationDescriptorSection_Unit extends AICFormationDescriptorSection { - - label = "Unit"; - name = "unit"; - - constructor() { - - super(); - - } - - - addUnitInformation( formation:AICFormation, contextData: AICFormationContextDataInterface, phrase: AICFormationDescriptorPhrase, options?:addUnitInformationInterface ) { - - options = options || {}; - - const originPoint = ( contextData.control === "broadcast" ) ? contextData.bullseyeName : "BRAA"; - - phrase.addComponent( new AICFormationDescriptorComponent( originPoint, "Bearing origin point" ) ); - phrase.addComponent( new AICFormationDescriptorComponent( "", "Bearing" ) ); - phrase.addComponent( new AICFormationDescriptorComponent( "", "Range" ) ); - phrase.addComponent( new AICFormationDescriptorComponent( "", "Altitude" ) ); - - if ( contextData.control === "broadcast" ) { - if ( !options.hasOwnProperty( "omitTrack" ) || options.omitTrack !== true ) { - phrase.addComponent( new AICFormationDescriptorComponent( "track ", "Tracking" ) ); - } - } else { - phrase.addComponent( new AICFormationDescriptorComponent( "[hot|flanking [left|right]|beam |cold]", "Azimuth" ) ); - } - - return phrase; - - } - - - generate( formation:AICFormation, contextData: AICFormationContextDataInterface ) { - - if ( formation.hasUnitBreakdown() ) { - - for ( const [ i, unitRef ] of formation.unitBreakdown.entries() ) { - - let phrase = new AICFormationDescriptorPhrase(); - - phrase.addComponent( new AICFormationDescriptorComponent( unitRef, "Unit reference" ) ); - - if ( i === 0 ) { - this.addUnitInformation( formation, contextData, phrase, { "omitTrack": true } ); - } else { - phrase.addComponent( new AICFormationDescriptorComponent( "" ) ); - } - - phrase.addComponent( new AICFormationDescriptorComponent( "hostile" ) ); - - this.addPhrase( phrase ); - - - } - - } else { - - this.addPhrase( - this.addUnitInformation( formation, contextData, new AICFormationDescriptorPhrase() ) - ); - - } - - return this; - - } - - -} \ No newline at end of file