AGS.Types.BuildTargetsInfo.RegisterBuildTarget C# (CSharp) Method

RegisterBuildTarget() public static method

Includes an IBuildTarget in the list of potential target build platforms.
public static RegisterBuildTarget ( IBuildTarget target ) : void
target IBuildTarget
return void
        public static void RegisterBuildTarget(IBuildTarget target)
        {
            if (target == null) throw new ArgumentNullException("Build targets cannot be null!");
            if (string.IsNullOrEmpty(target.Name)) throw new ArgumentException("Build target names cannot be null or empty!");
            foreach (IBuildTarget bt in _buildTargets)
            {
                if (bt == target) return;   // build target already registered, ignore it
                if (bt.Name == target.Name) // otherwise, if two targets share the same name
                {
                    throw new ArgumentException("Another build target with the same name ('" + target.Name + "') already exists.");
                }
            }
            _buildTargets.Add(target);
        }