public void Download(string targetPath, Language language, bool overwrite, InstallationType installationType,
                             string username, string password)
        {
            var completeList = _downloadListManager.GetEntriesToInstall(username, password, language, _config);
            var downloadList = completeList;

            if (!overwrite) {
                downloadList = _downloadListManager.FilterEntries(_config, language,
                                                                  downloadList, installationType);
            }

            var downloadManager = CreateDownloadManager(targetPath, username, password, language);

            downloadManager.DownloadList = downloadList;
            downloadManager.InstallationType = installationType;

            LogMessage("Det finns " + downloadList.Count + " nya filer att ladda ner.");
            downloadManager.Download();

            if (InstallationType.CODE.Equals(installationType) && downloadList.Count > 0) {
                LogMessage("Uppdaterar ini-fil");
                _config.CommitEntries(language, completeList);
                LogMessage("Ini-fil uppdaterad");
            }
        }
        public void Download(string targetPath, LanguageSelection selection, bool overwrite, InstallationType installationType,
                             string username, string password)
        {
            LogToFile("Downloading " + selection + " files of type " + installationType + " to " + targetPath);

            bool refresh = _config.NeedsRefresh(selection, installationType);
            DateTimeOffset refreshedAt = DateTimeOffset.Now;

            DownloadList downloadList = _downloadListManager.GetEntriesToInstall(targetPath, username, password, selection, installationType, overwrite || refresh);

            var downloadManager = CreateDownloadManager(targetPath, username, password, selection.Language);

            downloadManager.DownloadList = downloadList.Missing;
            downloadManager.InstallationType = installationType;
            downloadManager.LanguageSelection = selection;

            LogMessage(TextResources.thereAre + " " + downloadList.Missing.Count + " " + TextResources.newFilesToDownload);
            downloadManager.Download();

            if (InstallationType.CODE.Equals(installationType)) {
                LogMessage(TextResources.updatingIniFile);
                _config.CommitEntries(selection, downloadList.All);
                LogMessage(TextResources.iniFileUpdated);
            }

            if (refresh) {
                _config.UpdateRefresh(selection, installationType, refreshedAt);
            }
        }
        public DownloadList GetEntriesToInstall(string targetPath, string username, string password, LanguageSelection selection, InstallationType installationType, bool overwrite)
        {
            List<PictogramEntry> all = GetCompleteList(username, password, selection.Language, installationType);

            var missing = overwrite ? all : FilterEntries(targetPath, selection, all, installationType);

            return new DownloadList(all, missing);
        }
Beispiel #4
0
 public PicIni GetPictoIniFile(LanguageSelection selection, InstallationType installationType)
 {
     if (InstallationType.SOUND.Equals(installationType)) {
         return GetPictoWavIniFilePath(selection.Language);
     } else {
         return CreatePictoWmfIni(selection);
     }
 }
		public FluentApplicationRuntimeConfiguration(
			string company,
			string applicationName,
			InstallationType installationType,
			string[] subFolders)
		{
			Company = company;
			ApplicationName = applicationName;
			InstallationType = installationType;
			SubFolders = subFolders;
		}
Beispiel #6
0
    public InstallSetupStepAttribute(InstallationType installTypeTarget, string name, string view, int serverOrder, string description)
    {
        InstallTypeTarget = installTypeTarget;
        Name        = name;
        View        = view;
        ServerOrder = serverOrder;
        Description = description;

        // default
        PerformsAppRestart = false;
    }
Beispiel #7
0
 public FluentApplicationRuntimeConfiguration(
     string company,
     string applicationName,
     InstallationType installationType,
     string[] subFolders)
 {
     Company          = company;
     ApplicationName  = applicationName;
     InstallationType = installationType;
     SubFolders       = subFolders;
 }
        public void ResetInstallationsDataGrid(InstallationType typeOfInstallation)
        {
            dgvInstallations.DataSource = Installation.GetInstallations(typeOfInstallation);

            dgvInstallations.Columns["Cost"].DisplayIndex = 6;
            dgvInstallations.Columns["ID"].Width          = 30;
            dgvInstallations.Columns["OrderID"].Width     = 50;
            dgvInstallations.Columns["ProductCode"].Width = 80;
            dgvInstallations.Columns["Cost"].Width        = 50;
            dgvInstallations.Columns["Duration"].Width    = 70;
            dgvInstallations.Columns["StartDateTimeOfOperation"].HeaderText = "StartDate";
        }
Beispiel #9
0
        /// <summary>
        ///     Initialize a new <see cref="PackageProvider" />.
        /// </summary>
        public PackageProvider()
        {
            // Make sure that the project has the GDX preprocessor added
            if (ConfigProvider.Get().environmentScriptingDefineSymbol)
            {
                EnsureScriptingDefineSymbol();
            }

            // Find Local Definition
            // ReSharper disable once StringLiteralTypo
            string[] editorAssemblyDefinition = AssetDatabase.FindAssets("GDX.Editor t:asmdef");
            if (editorAssemblyDefinition.Length > 0)
            {
                // Establish package root path
                PackageAssetPath =
                    Path.Combine(
                        Path.GetDirectoryName(AssetDatabase.GUIDToAssetPath(editorAssemblyDefinition[0])) ??
                        string.Empty, "..", "..");

                // Build the package manifest path
                PackageManifestPath = Path.Combine(Application.dataPath.Substring(0, Application.dataPath.Length - 6),
                                                   PackageAssetPath ?? string.Empty, "package.json");

                // Make sure the file exists
                if (!File.Exists(PackageManifestPath))
                {
                    return;
                }
            }

            // Lets try and parse the package JSON
            try
            {
                Definition = JsonUtility.FromJson <PackageDefinition>(File.ReadAllText(PackageManifestPath));
            }
            catch (Exception)
            {
                // Don't go any further if there is an error
            }

            // It didn't actually parse correctly so lets just stop right now.
            if (Definition == null)
            {
                InstallationMethod = InstallationType.Unknown;
                return;
            }

            // Lets figure out where we came from
            (InstallationType installationType, string sourceTag) = GetInstallationType();
            InstallationMethod = installationType;
            SourceTag          = sourceTag;
        }
Beispiel #10
0
        public static List <Installation> GetInstallations(InstallationType typeOfInstallation)
        {
            List <Installation> installations = new List <Installation>();

            string tableName = "Installation";

            DataHandler.ResetDataSet();

            DataSet ds = new DataSet();

            switch (typeOfInstallation)
            {
            case InstallationType.COMPLETED:
                ds = DataHandler.GetDataSet(tableName, "SELECT * FROM Installation WHERE Duration IS NOT NULL");
                break;

            case InstallationType.SCHEDULED:
                ds = DataHandler.GetDataSet(tableName, "SELECT * FROM Installation WHERE Duration IS NULL");
                break;

            default:
                ds = DataHandler.GetDataSet(tableName);
                break;
            }

            foreach (DataRow row in ds.Tables[tableName].Rows)
            {
                string duration = row["Duration"].ToString();
                string cost     = row["Cost"].ToString();

                if ((duration == null || duration == "") && (cost == null || cost == ""))
                {
                    installations.Add(new Installation(int.Parse(row["InstallationID"].ToString()), int.Parse(row["OrderID"].ToString()), row["ProductCode"].ToString(), row["TechnicianID"].ToString(), DateTime.Parse(row["DateOfInstallation"].ToString()), null, null));
                }
                else if (duration == null || duration == "")
                {
                    installations.Add(new Installation(int.Parse(row["InstallationID"].ToString()), int.Parse(row["OrderID"].ToString()), row["ProductCode"].ToString(), row["TechnicianID"].ToString(), DateTime.Parse(row["DateOfInstallation"].ToString()), null, decimal.Parse(cost)));
                }
                else if (cost == null || cost == "")
                {
                    installations.Add(new Installation(int.Parse(row["InstallationID"].ToString()), int.Parse(row["OrderID"].ToString()), row["ProductCode"].ToString(), row["TechnicianID"].ToString(), DateTime.Parse(row["DateOfInstallation"].ToString()), int.Parse(duration), null));
                }
                else
                {
                    installations.Add(new Installation(int.Parse(row["InstallationID"].ToString()), int.Parse(row["OrderID"].ToString()), row["ProductCode"].ToString(), row["TechnicianID"].ToString(), DateTime.Parse(row["DateOfInstallation"].ToString()), int.Parse(duration), decimal.Parse(cost)));
                }
            }

            return(installations);
        }
        private List<PictogramEntry> GetCompleteList(string username, string password, Language language, InstallationType installationType)
        {
            List<PictogramEntry> completeList = null;

            switch (installationType) {
                case InstallationType.SOUND:
                    completeList = GetSoundEntries(username, password, language);
                    break;
                default:
                    completeList = GetEntriesToInstall(username, password, language);
                    break;
            }
            return completeList;
        }
		public static string RuntimePath(
			string company,
			string applicationName,
			InstallationType installationType,
			params string[] subFolders)
		{
			subFolders = subFolders ?? Enumerable.Empty<string>().ToArray();

			var localApplicationData = Environment.GetFolderPath(installationToPath[installationType]);

			var applicationWithSubFolders = new[] { localApplicationData, company, applicationName }.Union(subFolders).ToArray();

			var applicationPath = Path.Combine(applicationWithSubFolders);

			return applicationPath;
		}
Beispiel #13
0
        public static string RuntimePath(
            string company,
            string applicationName,
            InstallationType installationType,
            params string[] subFolders)
        {
            subFolders = subFolders ?? Enumerable.Empty <string>().ToArray();

            var localApplicationData = Environment.GetFolderPath(installationToPath[installationType]);

            var applicationWithSubFolders = new[] { localApplicationData, company, applicationName }.Union(subFolders).ToArray();

            var applicationPath = Path.Combine(applicationWithSubFolders);

            return(applicationPath);
        }
        private List<PictogramEntry> FilterEntries(string installPath, LanguageSelection selection,
            IEnumerable<PictogramEntry> entries, InstallationType installationType)
        {
            var newEntries = new List<PictogramEntry>();

            foreach (var entry in entries) {
                var fileName = entry.ToFilename(installationType, selection);

                var fileInfo = new FileInfo(installPath + @"\" + fileName);
                if (Files.shouldWriteTo(fileInfo, entry.Modified)) {
                    newEntries.Add(entry);
                }
            }

            return newEntries;
        }
Beispiel #15
0
        static string DisplayInstallTypeString(InstallationType installType)
        {
            switch (installType)
            {
            case InstallationType.Package:
                return("Installs to packages");

            case InstallationType.WriteablePackage:
                return("Installs to packages (writeable)");

            case InstallationType.UnityPackage:
                return("Installs to project");
            }

            return("");
        }
        public List<PictogramEntry> FilterEntries(Config config, Language language,
                                                          IEnumerable<PictogramEntry> entries, InstallationType installationType)
        {
            string installPath = config.getInstallPathForLanguage(language, installationType);

            var newEntries = new List<PictogramEntry>();

            foreach (var entry in entries) {
                var fileName = entry.ToFilename(installationType);

                var fileInfo = new FileInfo(installPath + @"\" + fileName);
                if (!fileInfo.Exists) {
                    newEntries.Add(entry);
                }
            }

            return newEntries;
        }
Beispiel #17
0
 /// <summary>
 /// Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>A hash code for the current <see cref="T:System.Object"/>.</returns>
 public override int GetHashCode()
 {
     return(Architecture.GetHashCode()
            ^ Bootable.GetHashCode()
            ^ CustomizedInfo.GetHashCode()
            ^ DefaultLanguageIndex
            ^ (String.IsNullOrEmpty(EditionId) ? 0 : EditionId.GetHashCode())
            ^ (String.IsNullOrEmpty(Hal) ? 0 : Hal.GetHashCode())
            ^ (String.IsNullOrEmpty(ImageDescription) ? 0 : ImageDescription.GetHashCode())
            ^ ImageIndex.GetHashCode()
            ^ ImageType.GetHashCode()
            ^ (String.IsNullOrEmpty(InstallationType) ? 0 : InstallationType.GetHashCode())
            ^ Languages.GetHashCode()
            ^ (String.IsNullOrEmpty(ProductName) ? 0 : ProductName.GetHashCode())
            ^ (String.IsNullOrEmpty(ProductSuite) ? 0 : ProductSuite.GetHashCode())
            ^ (String.IsNullOrEmpty(ProductType) ? 0 : ProductType.GetHashCode())
            ^ ProductVersion.GetHashCode()
            ^ SpLevel.GetHashCode()
            ^ (String.IsNullOrEmpty(SystemRoot) ? 0 : SystemRoot.GetHashCode()));
 }
Beispiel #18
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            string installationTypeAsString = cbInstallType.Text;
            string localPlugFile            = tbPath.Text;

            InstallationType type = InstallationType.ForUser;

            switch (installationTypeAsString)
            {
            case "For User":
                type = InstallationType.ForUser;
                break;

            case "For Current Project":
                type = InstallationType.ForCurrentProject;
                break;
            }

            Plugins.PluginManager.InstallPlugin(type, localPlugFile);
            Close();
        }
Beispiel #19
0
        /// <summary>
        ///     Get a friendly <see cref="string" /> name of an <see cref="InstallationType" />.
        /// </summary>
        /// <param name="installationType">The <see cref="InstallationType" /> to return a name for.</param>
        /// <returns>A friendly name for <paramref name="installationType" />.</returns>
        public static string GetFriendlyName(InstallationType installationType)
        {
            switch (installationType)
            {
            case InstallationType.UPM:
                return("Unity Package Manager");

            case InstallationType.UPMBranch:
                return("Unity Package Manager (Branch)");

            case InstallationType.UPMTag:
                return("Unity Package Manager (Tag)");

            case InstallationType.UPMCommit:
                return("Unity Package Manager (Commit)");

            case InstallationType.UPMLocal:
                return("Unity Package Manager (Local)");

            case InstallationType.GitHub:
                return("GitHub");

            case InstallationType.GitHubBranch:
                return("GitHub (Branch)");

            case InstallationType.GitHubTag:
                return("GitHub (Tag)");

            case InstallationType.GitHubCommit:
                return("GitHub (Commit)");

            case InstallationType.Assets:
                return("Asset Database");

            default:
                return("Unknown");
            }
        }
        internal void downloadImage(string Username, string Password, string pictogramCode, string languageCode, InstallationType installationType, LanguageSelection selection, Stream output)
        {
            int size = 500;

            if (selection.IsVectorFormat) {
                size = 96;
            }

            string url = "/languages/" + languageCode + "/pictograms/" + pictogramCode + "/images/" + size + "." + selection.ImageFormat.Extension;

            if (InstallationType.TEXTLESS.Equals(installationType)) {
                url += "?textless=true";
            }
            dynamic client = createRestClient(url, RestService.Binary).withCredentials(new NetworkCredential(Username, Password));

            dynamic operation = client.get();

            if (operation.Error != null) {
                throw operation.Error as Exception;
            }

            operation.Result.CopyTo(output);
        }
Beispiel #21
0
        public Installation(InstallationType a_eType)
            : base()
        {
            /// <summary>
            /// Id must be present or anything needing it will lose its cookies.
            /// </summary>

            Number = 0;
            Mass = 25000;
            Type = a_eType;
            m_aiMinerialsCost = new decimal[Constants.Minerals.NO_OF_MINERIALS];
            ThermalSignature = 0;
            EMSignature = 0;
            RequiredPrerequisitInstallation = InstallationType.InstallationCount;
            OutputInstallation = InstallationType.InstallationCount;
            RequiredTechnology = Faction.FactionTechnology.Count;
            RequiredTechLevel = -1;
            CanBeBuilt = true;

            switch (a_eType)
            {
                case InstallationType.AutomatedMine:
                    {
                        Name = "Automated Mine";
                        Cost = 240;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 120;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 120;
                        ThermalSignature = 5;
                        EMSignature = 5;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.CivilianMiningComplex:
                    {
                        Name = "Civilian Mining Complex";
                        ThermalSignature = 50;
                        EMSignature = 0;
                        CanBeBuilt = false;
                        break;
                    }
                case InstallationType.CommercialShipyard:
                    {
                        Name = "Commercial Shipyard Complex";
                        Cost = 2400;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 1200;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Neutronium] = 1200;
                        Mass = 100000;
                        SYInfo = new BindingList<ShipyardInformation>();

                        /// <summary>
                        /// For base
                        /// </summary>
                        ThermalSignature = 220;
                        EMSignature = 110;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.ConstructionFactory:
                    {
                        Name = "Construction Factory";
                        Cost = 120;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 60;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Tritanium] = 30;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 30;
                        ThermalSignature = 5;
                        EMSignature = 5;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.ConventionalIndustry:
                    {
                        Name = "Conventional Industry";
                        /// <summary>
                        /// CI can't be built, but can be converted for 20 cost to make other installations.
                        /// </summary>
                        Cost = 20;
                        ThermalSignature = 5;
                        EMSignature = 5;
                        CanBeBuilt = false;
                        break;
                    }
                case InstallationType.ConvertCIToConstructionFactory:
                    {
                        Name = "Convert CI to Construction Factory";
                        /// <summary>
                        /// CI can't be built, but can be converted for 20 cost to make other installations.
                        /// </summary>
                        Cost = 20;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 10;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Tritanium] = 5;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 5;
                        ThermalSignature = 5;
                        EMSignature = 5;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        RequiredPrerequisitInstallation = InstallationType.ConventionalIndustry;
                        OutputInstallation = InstallationType.ConstructionFactory;
                        break;
                    }
                case InstallationType.ConvertCIToFighterFactory:
                    {
                        Name = "Convert CI to Fighter Factory";
                        /// <summary>
                        /// CI can't be built, but can be converted for 20 cost to make other installations.
                        /// </summary>
                        Cost = 20;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 5;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium] = 15;
                        ThermalSignature = 5;
                        EMSignature = 5;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        RequiredPrerequisitInstallation = InstallationType.ConventionalIndustry;
                        OutputInstallation = InstallationType.FighterFactory;
                        break;
                    }
                case InstallationType.ConvertCIToFuelRefinery:
                    {
                        Name = "Convert CI to Fuel Refinery";
                        /// <summary>
                        /// CI can't be built, but can be converted for 20 cost to make other installations.
                        /// </summary>
                        Cost = 20;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 20;
                        ThermalSignature = 5;
                        EMSignature = 5;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        RequiredPrerequisitInstallation = InstallationType.ConventionalIndustry;
                        OutputInstallation = InstallationType.FuelRefinery;
                        break;
                    }
                case InstallationType.ConvertCIToMine:
                    {
                        Name = "Convert CI to Mine";
                        /// <summary>
                        /// CI can't be built, but can be converted for 20 cost to make other installations.
                        /// </summary>
                        Cost = 20;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 10;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 10;
                        ThermalSignature = 5;
                        EMSignature = 5;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        RequiredPrerequisitInstallation = InstallationType.ConventionalIndustry;
                        OutputInstallation = InstallationType.Mine;
                        break;
                    }
                case InstallationType.ConvertCIToOrdnanceFactory:
                    {
                        Name = "Convert CI to Ordnance Factory";
                        /// <summary>
                        /// CI can't be built, but can be converted for 20 cost to make other installations.
                        /// </summary>
                        Cost = 20;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 10;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 10;
                        ThermalSignature = 5;
                        EMSignature = 5;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        RequiredPrerequisitInstallation = InstallationType.ConventionalIndustry;
                        OutputInstallation = InstallationType.OrdnanceFactory;
                        break;
                    }
                case InstallationType.ConvertMineToAutomated:
                    {
                        Name = "Convert mine to Automated";
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 75;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 75;
                        ThermalSignature = 5;
                        EMSignature = 5;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        RequiredPrerequisitInstallation = InstallationType.Mine;
                        OutputInstallation = InstallationType.AutomatedMine;
                        break;
                    }

                case InstallationType.DeepSpaceTrackingStation:
                    {
                        Name = "DeepSpace Tracking Station";
                        Cost = 300;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 150;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium] = 150;
                        ThermalSignature = 5;
                        EMSignature = 0;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.FighterFactory:
                    {
                        Name = "Fighter Factory";
                        Cost = 120;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 30;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium] = 90;
                        ThermalSignature = 5;
                        EMSignature = 5;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.FinancialCentre:
                    {
                        Name = "Financial Centre";
                        Cost = 240;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corbomite] = 120;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium] = 120;
                        ThermalSignature = 5;
                        EMSignature = 50;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.FuelRefinery:
                    {
                        Name = "Fuel Refinery";
                        Cost = 120;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 120;
                        ThermalSignature = 5;
                        EMSignature = 5;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.GeneticModificationCentre:
                    {
                        Name = "Genetic Modification Centre";
                        Cost = 2400;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 300;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corbomite] = 1200;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Boronide] = 600;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Mercassium] = 300;
                        Mass = 50000;
                        ThermalSignature = 10;
                        EMSignature = 50;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.GroundForceTrainingFacility:
                    {
                        Name = "Ground Force Training Facility";
                        Cost = 2400;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 1200;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Neutronium] = 1200;
                        Mass = 100000;
                        ThermalSignature = 10;
                        EMSignature = 100;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.Infrastructure:
                    {
                        Name = "Infrastructure";
                        Cost = 2;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 2;
                        Mass = 2500;
                        ThermalSignature = 0.5f;
                        EMSignature = 0.5f;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.MaintenanceFacility:
                    {
                        Name = "Maintenance Facility";
                        Cost = 150;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 75;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Neutronium] = 75;
                        ThermalSignature = 5;
                        EMSignature = 5;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.MassDriver:
                    {
                        Name = "Mass Driver";
                        Cost = 300;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 100;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Neutronium] = 100;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Boronide] = 100;
                        ThermalSignature = 5;
                        EMSignature = 5;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.MilitaryAcademy:
                    {
                        Name = "Military Academy";
                        Cost = 2400;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 1200;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corbomite] = 300;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Tritanium] = 300;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium] = 300;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 300;
                        Mass = 100000;
                        ThermalSignature = 10;
                        EMSignature = 100;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.Mine:
                    {
                        Name = "Mine";
                        Cost = 120;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 60;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 60;
                        ThermalSignature = 5;
                        EMSignature = 5;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.NavalShipyardComplex:
                    {
                        Name = "Naval Shipyard Complex";
                        Cost = 2400;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 1200;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Neutronium] = 1200;
                        Mass = 100000;
                        SYInfo = new BindingList<ShipyardInformation>();

                        /// <summary>
                        /// base signatures.
                        /// </summary>
                        ThermalSignature = 220;
                        EMSignature = 110;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.OrdnanceFactory:
                    {
                        Name = "Ordnance Factory";
                        Cost = 120;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 30;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Tritanium] = 90;
                        ThermalSignature = 5;
                        EMSignature = 5;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.ResearchLab:
                    {
                        Name = "Research Lab";
                        Cost = 2400;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 1200;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Mercassium] = 1200;
                        Mass = 100000;
                        ThermalSignature = 50;
                        EMSignature = 100;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.SectorCommand:
                    {
                        Name = "Sector Command";
                        Cost = 2400;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 600;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Boronide] = 600;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Mercassium] = 600;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium] = 600;
                        Mass = 100000;
                        ThermalSignature = 20;
                        EMSignature = 150;
                        RequiredTechnology = Faction.FactionTechnology.ImprovedCommandAndControl;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.Spaceport:
                    {
                        Name = "Spaceport";
                        Cost = 1200;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 300;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corbomite] = 150;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Boronide] = 150;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Mercassium] = 300;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium] = 300;
                        Mass = 50000;
                        ThermalSignature = 50;
                        EMSignature = 100;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
                case InstallationType.TerraformingInstallation:
                    {
                        Name = "Terraforming Installation";
                        Cost = 600;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 300;
                        m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Boronide] = 300;
                        Mass = 50000;
                        ThermalSignature = 100;
                        EMSignature = 25;
                        RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                        RequiredTechLevel = 0;
                        CanBeBuilt = true;
                        break;
                    }
            }
        }
 /// <inheritdoc />
 public override int GetHashCode()
 {
     return(Version.GetHashCode() ^ InstallationType.GetHashCode());
 }
 /// <remarks/>
 public void EnhancedEnrollmentForOFFLINEAsync(string strXML, InstallationType InstallType)
 {
     this.EnhancedEnrollmentForOFFLINEAsync(strXML, InstallType, null);
 }
Beispiel #24
0
 public void UpdateRefresh(LanguageSelection selection, InstallationType installationType, DateTimeOffset refreshedAt)
 {
     string key = GetLastRefreshKey(selection, installationType);
     Profile settings = this.iniFileFactory.GetPictoIniFile(selection, installationType).ToIni();
     settings.SetValue("ProgDir", key, refreshedAt);
 }
Beispiel #25
0
 public static IApplicationRuntimeConfigurationName Name(string company, string applicationName, InstallationType installationType, params string[] subFolders)
 {
     return(new FluentApplicationRuntimeConfiguration(company, applicationName, installationType, subFolders));
 }
Beispiel #26
0
        public static bool InstallPlugin(InstallationType installationType, string localPlugFile)
        {
            bool succeeded = true;


            string installPath = null;

            //Validate install path
            switch (installationType)
            {
            case InstallationType.ForUser:
                // We're now going to install to a temporary location and copy those files
                // to their final location on a restart.

                //installPath = FileManager.UserApplicationData + @"\FRBDK\Plugins\";
                installPath = FileManager.UserApplicationDataForThisApplication + "InstalledPlugins\\";

                break;

            case InstallationType.ForCurrentProject:
                if (ProjectManager.GlueProjectFileName == null)
                {
                    MessageBox.Show(@"Can not select For Current Project because no project is currently open.");
                    succeeded = false;
                }

                if (succeeded)
                {
                    Directory.CreateDirectory(FileManager.GetDirectory(ProjectManager.GlueProjectFileName) + "Plugins");

                    installPath = FileManager.GetDirectory(ProjectManager.GlueProjectFileName) + "Plugins";
                }
                break;

            default:
                MessageBox.Show(@"Unknown install type.  Please select a valid install type.");
                succeeded = false;
                break;
            }

            if (succeeded)
            {
                //Validate plugin file
                if (!File.Exists(localPlugFile))
                {
                    MessageBox.Show(@"Please select a valid *.plug file to install.");
                    succeeded = false;
                }
            }

            if (succeeded)
            {
                //Do install
                using (var zip = new ZipFile(localPlugFile))
                {
                    var rootDirectory = GetRootDirectory(zip.EntryFileNames);

                    //Only allow one folder in zip
                    if (String.IsNullOrEmpty(rootDirectory))
                    {
                        MessageBox.Show(@"Unexpected *.plug format (No root directory found in plugin archive)");
                        succeeded = false;
                    }

                    if (succeeded)
                    {
                        //Delete existing folder
                        if (Directory.Exists(installPath + @"\" + rootDirectory))
                        {
                            Plugins.PluginManager.ReceiveOutput("Plugin file already exists: " + installPath + @"\" + rootDirectory);
                            DialogResult result = MessageBox.Show(@"Existing plugin already exists!  Do you want to replace it?", @"Confirm delete", MessageBoxButtons.YesNo);

                            if (result == DialogResult.Yes)
                            {
                                try
                                {
                                    FileManager.DeleteDirectory(installPath + rootDirectory);
                                }
                                catch (Exception exc)
                                {
                                    MessageBox.Show("Error trying to delete " + installPath + @"\" + rootDirectory + "\n\n" + exc.ToString());
                                    succeeded = false;
                                }
                            }
                            else
                            {
                                succeeded = false;
                            }
                        }

                        if (succeeded)
                        {
                            //Extract into install path
                            zip.ExtractAll(installPath);

                            Plugins.PluginManager.ReceiveOutput("Installed to " + installPath);

                            MessageBox.Show(@"Successfully installed.  Restart Glue to use the new plugin.");
                        }
                        else
                        {
                            MessageBox.Show("Failed to install plugin.");
                        }
                    }
                }
            }

            return(succeeded);
        }
 /// <remarks/>
 public void EnhancedEnrollmentForOfflineAsync(string strXML, InstallationType installType, object userState) {
     if ((this.EnhancedEnrollmentForOfflineOperationCompleted == null)) {
         this.EnhancedEnrollmentForOfflineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnhancedEnrollmentForOfflineOperationCompleted);
     }
     this.InvokeAsync("EnhancedEnrollmentForOffline", new object[] {
                 strXML,
                 installType}, this.EnhancedEnrollmentForOfflineOperationCompleted, userState);
 }
 /// <remarks/>
 public void EnhancedEnrollmentForOfflineAsync(string strXML, InstallationType installType) {
     this.EnhancedEnrollmentForOfflineAsync(strXML, installType, null);
 }
 public int EnhancedEnrollmentForOffline(string strXML, InstallationType installType) {
     object[] results = this.Invoke("EnhancedEnrollmentForOffline", new object[] {
                 strXML,
                 installType});
     return ((int)(results[0]));
 }
Beispiel #30
0
        /// <summary>
        /// Set installation type.
        /// Debug flag and machine name is used to decide which installation type to use.
        /// </summary>
        public static void SetInstallationType()
        {
#if !ARTPORTALEN_TEST
            if (Debug)
            {
                switch (Environment.MachineName)
                {
                case "ARTFAKTA-DEV":     // Team Species Fact test server.
                    InstallationType = InstallationType.SpeciesFactTest;
                    break;

                case "MONESES-ST":     // System test server.
                    InstallationType = InstallationType.SystemTest;
                    break;

                case "SLU011837":     //
                    InstallationType = InstallationType.TwoBlueberriesTest;
                    break;

                case "SLU010288":     //
                    InstallationType = InstallationType.SpeciesFactTest;
                    break;

                case "SLU011360":     //
                    InstallationType = InstallationType.SpeciesFactTest;
                    break;

                case "SLU012767":     //
                    InstallationType = InstallationType.SpeciesFactTest;
                    break;

                case "SLU005126":     //
                    InstallationType = InstallationType.SpeciesFactTest;
                    break;

                case "SLU010940":     //
                    InstallationType = InstallationType.SpeciesFactTest;
                    break;

                case "SLU004816":     //
                    InstallationType = InstallationType.SpeciesFactTest;
                    break;

                case "SLU011896":     //
                    InstallationType = InstallationType.SpeciesFactTest;
                    break;

                case "SLU012177":     //
                    InstallationType = InstallationType.SpeciesFactTest;
                    break;

                case "SLW-DEV":     // Team Two Blueberries test server.
                    InstallationType = InstallationType.TwoBlueberriesTest;
                    break;

                case "SLU012925":     //
                    InstallationType = InstallationType.TwoBlueberriesTest;
                    break;

                case "SLU011730":     //
                    InstallationType = InstallationType.TwoBlueberriesTest;
                    break;

                case "SLU004994":     //
                    InstallationType = InstallationType.TwoBlueberriesTest;
                    break;

                case "SLU011161":     //
                    InstallationType = InstallationType.TwoBlueberriesTest;
                    break;

                default:
                    InstallationType = InstallationType.ServerTest;
                    break;
                }
            }
            else
            {
                InstallationType = InstallationType.Production;
            }
#endif
        }
Beispiel #31
0
 /// <remarks/>
 public System.IAsyncResult BeginEnhancedEnrollmentForOffline(string strXML, InstallationType installType, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("EnhancedEnrollmentForOffline", new object[] {
                                                                              strXML,
                                                                              installType}, callback, asyncState);
 }
Beispiel #32
0
 public string getInstallPathForLanguage(LanguageSelection selection, InstallationType installationType)
 {
     switch (installationType) {
         case InstallationType.PLAIN_TEXT:
             return GetPictoPlainTextInstallPath(selection);
         case InstallationType.SOUND:
             return GetPictoSoundInstallPath(selection.Language);
         case InstallationType.TEXTLESS:
             return GetTextLessInstallPath(selection);
         case InstallationType.CODE:
             /* fall-through */
         default:
             return GetPictoInstallPath(selection);
     }
 }
		public static IApplicationRuntimeConfigurationName Name(string company, string applicationName, InstallationType installationType, params string[] subFolders)
		{
			return new FluentApplicationRuntimeConfiguration(company, applicationName, installationType, subFolders);
		}
		public static string DebugOrRuntimePath(string company, string applicationName, string projectName, InstallationType programFilesX86, params string[] subFolders)
		{
			var isAttached = SystemInspector.Debugger.IsAttached;

			return isAttached ? DebugPath(projectName) : RuntimePath(company, applicationName, subFolders);
		}
        public static bool InstallPlugin(InstallationType installationType, string localPlugFile)
        {
            bool succeeded = true;


            string installPath = null;
            //Validate install path
            switch (installationType)
            {
                case InstallationType.ForUser:
                    // We're now going to install to a temporary location and copy those files
                    // to their final location on a restart.

                    //installPath = FileManager.UserApplicationData + @"\FRBDK\Plugins\";
                    installPath = FileManager.UserApplicationDataForThisApplication + "InstalledPlugins\\";

                    break;
                case InstallationType.ForCurrentProject:
                    if (ProjectManager.GlueProjectFileName == null)
                    {
                        MessageBox.Show(@"Can not select For Current Project because no project is currently open.");
                        succeeded = false;
                    }

                    if (succeeded)
                    {
                        Directory.CreateDirectory(FileManager.GetDirectory(ProjectManager.GlueProjectFileName) + "Plugins");

                        installPath = FileManager.GetDirectory(ProjectManager.GlueProjectFileName) + "Plugins";
                    }
                    break;
                default:
                    MessageBox.Show(@"Unknown install type.  Please select a valid install type.");
                    succeeded = false;
                    break;
            }

            if (succeeded)
            {
                //Validate plugin file
                if (!File.Exists(localPlugFile))
                {
                    MessageBox.Show(@"Please select a valid *.plug file to install.");
                    succeeded = false;
                }
            }

            if (succeeded)
            {
                //Do install
                using (var zip = new ZipFile(localPlugFile))
                {
                    var rootDirectory = GetRootDirectory(zip.EntryFileNames);

                    //Only allow one folder in zip
                    if (String.IsNullOrEmpty(rootDirectory))
                    {
                        MessageBox.Show(@"Unexpected *.plug format (No root directory found in plugin archive)");
                        succeeded = false;
                    }

                    if (succeeded)
                    {

                        //Delete existing folder
                        if (Directory.Exists(installPath + @"\" + rootDirectory))
                        {
                            Plugins.PluginManager.ReceiveOutput("Plugin file already exists: " + installPath + @"\" + rootDirectory);
                            DialogResult result = MessageBox.Show(@"Existing plugin already exists!  Do you want to replace it?", @"Confirm delete", MessageBoxButtons.YesNo);

                            if (result == DialogResult.Yes)
                            {
                                try
                                {
                                    FileManager.DeleteDirectory(installPath + rootDirectory);
                                }
                                catch (Exception exc)
                                {
                                    MessageBox.Show("Error trying to delete " + installPath + @"\" + rootDirectory + "\n\n" + exc.ToString());
                                    succeeded = false;
                                }
                            }
                            else
                            {
                                succeeded = false;
                            }
                        }

                        if (succeeded)
                        {
                            //Extract into install path
                            zip.ExtractAll(installPath);

                            Plugins.PluginManager.ReceiveOutput("Installed to " + installPath);

                            MessageBox.Show(@"Successfully installed.  Restart Glue to use the new plugin.");
                        }
                        else
                        {
                            MessageBox.Show("Failed to install plugin.");

                        }
                    }
                }
            }

            return succeeded;
        }
Beispiel #36
0
        public static string DebugOrRuntimePath(string company, string applicationName, string projectName, InstallationType programFilesX86, params string[] subFolders)
        {
            var isAttached = SystemInspector.Debugger.IsAttached;

            return(isAttached ? DebugPath(projectName) : RuntimePath(company, applicationName, subFolders));
        }
Beispiel #37
0
        public Installation(InstallationType a_eType)
        {
            /// <summary>
            /// Id must be present or anything needing it will lose its cookies.
            /// </summary>
            Id = Guid.NewGuid();

            Number            = 0;
            Mass              = 25000;
            Tonnage           = new BindingList <int>();
            Slipways          = new BindingList <int>();
            Type              = a_eType;
            m_aiMinerialsCost = new decimal[Constants.Minerals.NO_OF_MINERIALS];
            ThermalSignature  = 0;
            EMSignature       = 0;
            RequiredPrerequisitInstallation = InstallationType.InstallationCount;
            OutputInstallation = InstallationType.InstallationCount;
            RequiredTechnology = Faction.FactionTechnology.Count;
            RequiredTechLevel  = -1;
            CanBeBuilt         = true;

            switch (a_eType)
            {
            case InstallationType.AutomatedMine:
            {
                Name = "Automated Mine";
                Cost = 240;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]  = 120;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 120;
                ThermalSignature   = 5;
                EMSignature        = 5;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }

            case InstallationType.CivilianMiningComplex:
            {
                Name             = "Civilian Mining Complex";
                ThermalSignature = 50;
                EMSignature      = 0;
                CanBeBuilt       = false;
                break;
            }

            case InstallationType.CommercialShipyard:
            {
                Name = "Commercial Shipyard Complex";
                Cost = 2400;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]   = 1200;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Neutronium] = 1200;
                Mass = 100000;
                Tonnage.Add(10000);
                Slipways.Add(1);

                /// <summary>
                /// For base
                /// </summary>
                ThermalSignature   = 220;
                EMSignature        = 110;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }

            case InstallationType.ConstructionFactory:
            {
                Name = "Construction Factory";
                Cost = 120;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]  = 60;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Tritanium] = 30;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 30;
                ThermalSignature   = 5;
                EMSignature        = 5;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }

            case InstallationType.ConventionalIndustry:
            {
                Name = "Conventional Industry";
                /// <summary>
                /// CI can't be built, but can be converted for 20 cost to make other installations.
                /// </summary>
                Cost             = 20;
                ThermalSignature = 5;
                EMSignature      = 5;
                CanBeBuilt       = false;
                break;
            }

            case InstallationType.ConvertCIToConstructionFactory:
            {
                Name = "Convert CI to Construction Factory";
                /// <summary>
                /// CI can't be built, but can be converted for 20 cost to make other installations.
                /// </summary>
                Cost = 20;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]  = 10;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Tritanium] = 5;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 5;
                ThermalSignature   = 5;
                EMSignature        = 5;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                RequiredPrerequisitInstallation = InstallationType.ConventionalIndustry;
                OutputInstallation = InstallationType.ConstructionFactory;
                break;
            }

            case InstallationType.ConvertCIToFighterFactory:
            {
                Name = "Convert CI to Fighter Factory";
                /// <summary>
                /// CI can't be built, but can be converted for 20 cost to make other installations.
                /// </summary>
                Cost = 20;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 5;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium]  = 15;
                ThermalSignature   = 5;
                EMSignature        = 5;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                RequiredPrerequisitInstallation = InstallationType.ConventionalIndustry;
                OutputInstallation = InstallationType.FighterFactory;
                break;
            }

            case InstallationType.ConvertCIToFuelRefinery:
            {
                Name = "Convert CI to Fuel Refinery";
                /// <summary>
                /// CI can't be built, but can be converted for 20 cost to make other installations.
                /// </summary>
                Cost = 20;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 20;
                ThermalSignature   = 5;
                EMSignature        = 5;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                RequiredPrerequisitInstallation = InstallationType.ConventionalIndustry;
                OutputInstallation = InstallationType.FuelRefinery;
                break;
            }

            case InstallationType.ConvertCIToMine:
            {
                Name = "Convert CI to Mine";
                /// <summary>
                /// CI can't be built, but can be converted for 20 cost to make other installations.
                /// </summary>
                Cost = 20;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]  = 10;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 10;
                ThermalSignature   = 5;
                EMSignature        = 5;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                RequiredPrerequisitInstallation = InstallationType.ConventionalIndustry;
                OutputInstallation = InstallationType.Mine;
                break;
            }

            case InstallationType.ConvertCIToOrdnanceFactory:
            {
                Name = "Convert CI to Ordnance Factory";
                /// <summary>
                /// CI can't be built, but can be converted for 20 cost to make other installations.
                /// </summary>
                Cost = 20;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]  = 10;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 10;
                ThermalSignature   = 5;
                EMSignature        = 5;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                RequiredPrerequisitInstallation = InstallationType.ConventionalIndustry;
                OutputInstallation = InstallationType.OrdnanceFactory;
                break;
            }

            case InstallationType.ConvertMineToAutomated:
            {
                Name = "Convert mine to Automated";
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]  = 75;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 75;
                ThermalSignature   = 5;
                EMSignature        = 5;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                RequiredPrerequisitInstallation = InstallationType.Mine;
                OutputInstallation = InstallationType.AutomatedMine;
                break;
            }

            case InstallationType.DeepSpaceTrackingStation:
            {
                Name = "DeepSpace Tracking Station";
                Cost = 300;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 150;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium]  = 150;
                ThermalSignature   = 5;
                EMSignature        = 0;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }

            case InstallationType.FighterFactory:
            {
                Name = "Fighter Factory";
                Cost = 120;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 30;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium]  = 90;
                ThermalSignature   = 5;
                EMSignature        = 5;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }

            case InstallationType.FinancialCentre:
            {
                Name = "Financial Centre";
                Cost = 240;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corbomite] = 120;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium]   = 120;
                ThermalSignature   = 5;
                EMSignature        = 50;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }

            case InstallationType.FuelRefinery:
            {
                Name = "Fuel Refinery";
                Cost = 120;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 120;
                ThermalSignature   = 5;
                EMSignature        = 5;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }

            case InstallationType.GeneticModificationCentre:
            {
                Name = "Genetic Modification Centre";
                Cost = 2400;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]   = 300;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corbomite]  = 1200;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Boronide]   = 600;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Mercassium] = 300;
                Mass               = 50000;
                ThermalSignature   = 10;
                EMSignature        = 50;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }

            case InstallationType.GroundForceTrainingFacility:
            {
                Name = "Ground Force Training Facility";
                Cost = 2400;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]   = 1200;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Neutronium] = 1200;
                Mass               = 100000;
                ThermalSignature   = 10;
                EMSignature        = 100;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }

            case InstallationType.Infrastructure:
            {
                Name = "Infrastructure";
                Cost = 2;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 2;
                Mass             = 2500;
                ThermalSignature = 0.5f;
                EMSignature      = 0.5f;
                CanBeBuilt       = true;
                break;
            }

            case InstallationType.MaintenanceFacility:
            {
                Name = "Maintenance Facility";
                Cost = 150;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]   = 75;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Neutronium] = 75;
                ThermalSignature = 5;
                EMSignature      = 5;
                CanBeBuilt       = true;
                break;
            }

            case InstallationType.MassDriver:
            {
                Name = "Mass Driver";
                Cost = 300;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]   = 100;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Neutronium] = 100;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Boronide]   = 100;
                ThermalSignature   = 5;
                EMSignature        = 5;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }

            case InstallationType.MilitaryAcademy:
            {
                Name = "Military Academy";
                Cost = 2400;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]  = 1200;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corbomite] = 300;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Tritanium] = 300;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium]   = 300;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 300;
                Mass             = 100000;
                ThermalSignature = 10;
                EMSignature      = 100;
                CanBeBuilt       = true;
                break;
            }

            case InstallationType.Mine:
            {
                Name = "Mine";
                Cost = 120;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]  = 60;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 60;
                ThermalSignature   = 5;
                EMSignature        = 5;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }

            case InstallationType.NavalShipyardComplex:
            {
                Name = "Naval Shipyard Complex";
                Cost = 2400;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]   = 1200;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Neutronium] = 1200;
                Mass = 100000;
                Tonnage.Add(1000);
                Slipways.Add(1);
                /// <summary>
                /// base signatures.
                /// </summary>
                ThermalSignature   = 220;
                EMSignature        = 110;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }

            case InstallationType.OrdnanceFactory:
            {
                Name = "Ordnance Factory";
                Cost = 120;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]  = 30;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Tritanium] = 90;
                ThermalSignature   = 5;
                EMSignature        = 5;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }

            case InstallationType.ResearchLab:
            {
                Name = "Research Lab";
                Cost = 2400;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]   = 1200;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Mercassium] = 1200;
                Mass               = 100000;
                ThermalSignature   = 50;
                EMSignature        = 100;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }

            case InstallationType.SectorCommand:
            {
                Name = "Sector Command";
                Cost = 2400;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]   = 600;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Boronide]   = 600;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Mercassium] = 600;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium]    = 600;
                Mass               = 100000;
                ThermalSignature   = 20;
                EMSignature        = 150;
                RequiredTechnology = Faction.FactionTechnology.ImprovedCommandAndControl;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }

            case InstallationType.Spaceport:
            {
                Name = "Spaceport";
                Cost = 1200;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium]   = 300;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corbomite]  = 150;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Boronide]   = 150;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Mercassium] = 300;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium]    = 300;
                Mass               = 50000;
                ThermalSignature   = 50;
                EMSignature        = 100;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }

            case InstallationType.TerraformingInstallation:
            {
                Name = "Terraforming Installation";
                Cost = 600;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 300;
                m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Boronide] = 300;
                Mass               = 50000;
                ThermalSignature   = 100;
                EMSignature        = 25;
                RequiredTechnology = Faction.FactionTechnology.TransNewtonianTech;
                RequiredTechLevel  = 0;
                CanBeBuilt         = true;
                break;
            }
            }
        }
Beispiel #38
0
 private string GetLastRefreshKey(LanguageSelection selection, InstallationType installationType)
 {
     switch (installationType) {
         case InstallationType.PLAIN_TEXT:
             return "PlainTextRefresh";
         case InstallationType.TEXTLESS:
             return "TextlessRefresh";
         case InstallationType.SOUND:
             return "SoundRefresh";
         case InstallationType.CODE:
         /* fall-through */
         default:
             return "DirRefresh";
     }
 }
Beispiel #39
0
        public bool NeedsRefresh(LanguageSelection selection, InstallationType installationType)
        {
            string key = GetLastRefreshKey(selection, installationType);

            Profile settings = this.iniFileFactory.GetPictoIniFile(selection, installationType).ToIni();

            string unparsed = settings.GetValue("ProgDir", key) as string;

            if (string.IsNullOrEmpty(unparsed)) {
                return true;
            }

            try {
                DateTimeOffset dto = DateTimeOffset.Parse(unparsed);

                /* Set to later date to force refresh at a later time. */
                DateTimeOffset cutoff = DateTimeOffset.Parse("2013-07-10 21:00:00 +02:00");

                if (selection.ImageFormat.IsSvg) {
                    cutoff = DateTimeOffset.Parse("2014-02-05 00:00:00 +02:00");

                    if (InstallationType.TEXTLESS.Equals(installationType)) {
                        cutoff = DateTimeOffset.Parse("2015-11-28 18:50:00 +01:00");
                    }
                }

                if (dto.CompareTo(cutoff) < 0) {
                    return true;
                }

            } catch (FormatException) {
                return true;
            }

            return false;
        }