// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace AutomationTool { /// /// Base class for buildcommands. /// public abstract class BuildCommand : CommandUtils { /// /// Build command entry point. Throws AutomationExceptions on failure. /// public virtual void ExecuteBuild() { throw new AutomationException("Either Execute() or ExecuteBuild() should be implemented for {0}", GetType().Name); } /// /// Command entry point. /// public virtual ExitCode Execute() { ExecuteBuild(); return ExitCode.Success; } /// /// Executes a new command as a child of another command. /// /// /// public static ExitCode Execute(BuildCommand ParentCommand) where T : BuildCommand, new() { T Command = new T(); if (ParentCommand != null) { Command.Params = ParentCommand.Params; } return Command.Execute(); } } }