//method used for copying RegionAction without reference public RegionAction(RegionAction r) { name = (string[])r.name.Clone(); description = (string[])r.description.Clone(); actionMoneyCost = r.actionMoneyCost; afterInvestmentActionMoneyCost = r.afterInvestmentActionMoneyCost; actionMoneyReward = r.actionMoneyReward; actionDuration = r.actionDuration; possibleSectors = (string[])r.possibleSectors.Clone(); pickedSectors = (bool[])r.pickedSectors.Clone(); actionCooldown = r.actionCooldown; isUnique = r.isUnique; temporaryConsequencesDuration = r.temporaryConsequencesDuration; consequences = new SectorStatistics(r.consequences); afterInvestmentConsequences = new SectorStatistics(r.afterInvestmentConsequences); temporaryConsequences = new SectorStatistics(r.temporaryConsequences); afterInvestmentTemporaryConsequences = new SectorStatistics(r.afterInvestmentTemporaryConsequences); startYear = r.startYear; startMonth = r.startMonth; lastCompleted = r.lastCompleted; isActive = r.isActive; endTemporaryConsequencesMonth = r.endTemporaryConsequencesMonth; isAvailable = r.isAvailable; conditionsAreRegional = r.conditionsAreRegional; startAvailableYear = r.startAvailableYear; startAvailableMonth = r.startAvailableMonth; endAvailableYear = r.endAvailableYear; endAvailableMonth = r.endAvailableMonth; availableConditionsMinimum = new SectorStatistics(r.availableConditionsMinimum); availableConditionsMaximum = new SectorStatistics(r.availableConditionsMaximum); }
public void StartAction(RegionAction action, Game game, bool[] pickedSectors) { foreach (bool isTrue in pickedSectors) { if (isTrue) { game.gameStatistics.ModifyMoney(action.afterInvestmentActionMoneyCost, false); } } action.ActivateAction(game.currentYear, game.currentMonth, pickedSectors); }
public void AddCompletedAction(MapRegion region, RegionAction action) { for (int i = 0; i < reportRegions.Length; i++) { if (region.name[0] == reportRegions[i]) { completedActions[i].Add(action); break; } } }
/*updates the sector statistics with the consequences of the action, method received both the action and statistics because * /the statistics can be either normal consequences or temporary consequences*/ public void ImplementActionConsequences(RegionAction regionAction, SectorStatistics statistics, bool isAdded, double happiness) { for (int i = 0; i < regionAction.possibleSectors.Count(); i++) { if (regionAction.pickedSectors[i]) { foreach (RegionSector sector in sectors) { if (sector.sectorName[0] == regionAction.possibleSectors[i]) { sector.ImplementStatisticValues(statistics, isAdded, happiness); } } } } }
/// <summary> /// Determines whether the region contains an action. /// </summary> /// <param name="action">The action.</param> /// <returns>True or false.</returns> public bool HasAction(RegionAction action) { return(Actions.Contains(action)); }
public void StartOtherPlayerAction(RegionAction action, Game game, bool[] pickedSectors) { action.ActivateAction(game.currentYear, game.currentMonth, pickedSectors); action.isOwnAction = false; }
public void AddCompletedActionToReports(MapRegion region, RegionAction action) { monthlyReport.AddCompletedAction(region, action); yearlyReport.AddCompletedAction(region, action); }
private void doAction(MapRegion region, RegionAction ra) { Debug.Log("NEW ACTION: " + ra.description[0] + " in Regio: " + region.name[0]); region.StartAction(ra, gameController.game, new bool[] { true, true, true }); }
public override void CreateAssetAction() { buyAssetAction = new RegionAction(LocalizationManager.instance.GetLocalizedValue("Buy Ship"), shipPrice, BuyAsset); }
public override void CreateAssetAction() { buyAssetAction = new RegionAction(LocalizationManager.instance.GetLocalizedValue("Hire Ambassador"), (int)branchCost, BuyAsset); }