import { LineResults } from "../LineResults" ; import { CommandNames } from "../Names/CommandNames" ; import { Command } from "./Command" ; import { CommandMetadata } from "./Metadata/CommandMetadata" ; import { SingleParameter } from "./Metadata/Parameters/SingleParameter" ; /**
 * Initializes a new array of an integer size.
 */ export class ArrayNewSizedCommand extends Command { /**
     * Metadata on the command.
     */ private static metadata : CommandMetadata = new CommandMetadata ( CommandNames . ArrayNewSized ) . withDescription ( "Initializes a new array" ) . withParameters ( [ new SingleParameter ( "type" , "The type of object." , true ) , new SingleParameter ( "size" , "Length of the array." , true ) , ] ) ; returns public getMetadata ( ) { return ArrayNewSizedCommand . metadata ; } param parameters returns public render ( parameters ) { let line = "" ; line += this . language . syntax . arrays . newSized . left ; if ( this . language . syntax . arrays . newSized . includeType ) { line += parameters [ 1 ] ; line += this . language . syntax . arrays . newSized . middle ; } line += parameters [ 2 ] ; line += this . language . syntax . arrays . newSized . right ; return LineResults . newSingleLine ( line ) . withImports ( this . language . syntax . arrays . requiredImports ) ; } }