public void SetStorage(ObjectStorage storage) { UpgradedStorage = storage; UpgradedProtection = storage.Protection; if (Level != null) { Level.text = storage.Level.ToString(); } if (UpgradePoints != null) { UpgradePoints.text = storage.UpgradePoints.ToString(); } if (UpgradePointsPanel != null) { UpgradePointsPanel.SetActive(storage.UpgradePoints > 0); } ProtectionUpgradeUI.MaxValue = 10; ProtectionUpgradeUI.FreePoints = storage.UpgradePoints; for (int i = 0; i < ImpactFactors.FieldsCount; i++) { if (i < FactorProtection.Length ? FactorProtection[i] != null : false) { FactorProtection[i].SetBaseValue((int)storage.Protection[i], (int)SessionData.Data.Researches.ResearchedTechs[i]); } } UpgradeButton.interactable = SessionData.Data.ResourceStorage.Money >= 40; }
public static ImpactFactors operator*(ImpactFactors A, float c) { ImpactFactors result = new ImpactFactors(0); for (int i = 0; i < FieldsCount; i++) { result[i] = A[i] * c; } return(result); }
public static ImpactFactors operator+(ImpactFactors A, ImpactFactors B) { ImpactFactors result = new ImpactFactors(0); for (int i = 0; i < FieldsCount; i++) { result[i] = A[i] + B[i]; } return(result); }
//public delegate void Message(); //public event Message ResearchIsOver; //public event Message ResearchUpdated; public AnomalObject(int ID, string Name, string Image, float FullResearchPoints, string Description, ResearchRepot[] Reports, ImpactFactors Properties) { this.ID = ID; this.Name = Name; this.image = Image; this.FullResearchPoints = FullResearchPoints; this.Description = Description; this.Reports = Reports; this.Properties = Properties; }
public ImpactFactors AnomalObjectPropertiesToResearches(ImpactFactors Properties) { ImpactFactors result = new ImpactFactors(0); for (int i = 0; i < ImpactFactors.FieldsCount; i++) { result[i] = GameData.Data.LevelsData.GetResearchesPointsByProperty((int)Properties[i]); } return(result); }
public void Research(ImpactFactors Researches, AnomalObject ResearchedObject) { ResearchesProgress += Researches; for (int i = 0; i < ImpactFactors.FieldsCount; i++) { if (i != 6) { if (ResearchedTechs[i] >= ImpactFactors.MaxValue) { ResearchesProgress[i] = 0; ResearchedTechs[i] = ImpactFactors.MaxValue; } if (ResearchesProgress[i] > GameData.Data.LevelsData.GetResearchesPointsToNextLevel((int)ResearchedTechs[i])) { ResearchesProgress[i] = ResearchesProgress[i] - GameData.Data.LevelsData.GetResearchesPointsToNextLevel((int)ResearchedTechs[i]); ResearchedObject.Description += '\n' + GameData.Data.LevelsData.GetDiscoveryDescription(i, (int)ResearchedTechs[i]); Kanban.Board.ResearchesUpdated("New technogy discovered", ResearchedObject); ResearchedTechs[i]++; } } } }