public ArmyDataModel GetAllArmyDataModel() { ArmyDataModel tempDataModel = _fiefService.ArmyList[0]; tempDataModel.ArmyCrossbowmen = 0; tempDataModel.ArmyBowmen = 0; tempDataModel.ArmyMedics = 0; tempDataModel.ArmyMedicsSkilled = 0; tempDataModel.ArmyInfantry = 0; tempDataModel.ArmyInfantryMedium = 0; tempDataModel.ArmyInfantryHeavy = 0; tempDataModel.ArmyInfantryElite = 0; tempDataModel.ArmyLongbowmen = 0; tempDataModel.ArmyMercenary = 0; tempDataModel.ArmyMercenaryElite = 0; tempDataModel.ArmyMercenaryBowmen = 0; tempDataModel.ArmyEngineers = 0; tempDataModel.ArmySpearmen = 0; tempDataModel.ArmyScouts = 0; tempDataModel.ArmyScoutsSkilled = 0; tempDataModel.ArmyKnightTemplars = 0; tempDataModel.ArmyGuards = 0; tempDataModel.ArmyWeaponmasters = 0; tempDataModel.CavalryBowmen = 0; tempDataModel.CavalryCourier = 0; tempDataModel.CavalryLight = 0; tempDataModel.CavalryKnights = 0; tempDataModel.CavalryScouts = 0; tempDataModel.CavalryKnightTemplars = 0; tempDataModel.CavalryHeavy = 0; tempDataModel.CavalryElite = 0; tempDataModel.OfficersCorporal = 0; tempDataModel.OfficersSergeant = 0; tempDataModel.OfficersCaptain = 0; for (int x = 1; x < _fiefService.ArmyList.Count; x++) { tempDataModel.ArmyCrossbowmen += _fiefService.ArmyList[x].ArmyCrossbowmen; tempDataModel.ArmyBowmen += _fiefService.ArmyList[x].ArmyBowmen; tempDataModel.ArmyMedics += _fiefService.ArmyList[x].ArmyMedics; tempDataModel.ArmyMedicsSkilled += _fiefService.ArmyList[x].ArmyMedicsSkilled; tempDataModel.ArmyInfantry += _fiefService.ArmyList[x].ArmyInfantry; tempDataModel.ArmyInfantryMedium += _fiefService.ArmyList[x].ArmyInfantryMedium; tempDataModel.ArmyInfantryHeavy += _fiefService.ArmyList[x].ArmyInfantryHeavy; tempDataModel.ArmyInfantryElite += _fiefService.ArmyList[x].ArmyInfantryElite; tempDataModel.ArmyLongbowmen += _fiefService.ArmyList[x].ArmyLongbowmen; tempDataModel.ArmyMercenary += _fiefService.ArmyList[x].ArmyMercenary; tempDataModel.ArmyMercenaryElite += _fiefService.ArmyList[x].ArmyMercenaryElite; tempDataModel.ArmyMercenaryBowmen += _fiefService.ArmyList[x].ArmyMercenaryBowmen; tempDataModel.ArmyEngineers += _fiefService.ArmyList[x].ArmyEngineers; tempDataModel.ArmySpearmen += _fiefService.ArmyList[x].ArmySpearmen; tempDataModel.ArmyScouts += _fiefService.ArmyList[x].ArmyScouts; tempDataModel.ArmyScoutsSkilled += _fiefService.ArmyList[x].ArmyScoutsSkilled; tempDataModel.ArmyKnightTemplars += _fiefService.ArmyList[x].ArmyKnightTemplars; tempDataModel.ArmyGuards += _fiefService.ArmyList[x].ArmyGuards; tempDataModel.ArmyWeaponmasters += _fiefService.ArmyList[x].ArmyWeaponmasters; tempDataModel.CavalryBowmen += _fiefService.ArmyList[x].CavalryBowmen; tempDataModel.CavalryCourier += _fiefService.ArmyList[x].CavalryCourier; tempDataModel.CavalryLight += _fiefService.ArmyList[x].CavalryLight; tempDataModel.CavalryKnights += _fiefService.ArmyList[x].CavalryKnights; tempDataModel.CavalryScouts += _fiefService.ArmyList[x].CavalryScouts; tempDataModel.CavalryKnightTemplars += _fiefService.ArmyList[x].CavalryKnightTemplars; tempDataModel.CavalryHeavy += _fiefService.ArmyList[x].CavalryHeavy; tempDataModel.CavalryElite += _fiefService.ArmyList[x].CavalryElite; tempDataModel.OfficersCorporal += _fiefService.ArmyList[x].OfficersCorporal; tempDataModel.OfficersSergeant += _fiefService.ArmyList[x].OfficersSergeant; tempDataModel.OfficersCaptain += _fiefService.ArmyList[x].OfficersCaptain; } return(tempDataModel); }
public void SetDataModel(IDataModelBase dataModel, int index) { if (dataModel != null) { if (dataModel.GetType() == typeof(InformationDataModel)) { InformationDataModel tempDataModel = (InformationDataModel)dataModel; _fiefService.InformationList[index] = (InformationDataModel)tempDataModel.Clone(); } else if (dataModel.GetType() == typeof(ArmyDataModel)) { ArmyDataModel tempDataModel = (ArmyDataModel)dataModel; _fiefService.ArmyList[index] = (ArmyDataModel)tempDataModel.Clone(); } else if (dataModel.GetType() == typeof(EmployeesDataModel)) { EmployeesDataModel tempDataModel = (EmployeesDataModel)dataModel; _fiefService.EmployeesList[index] = (EmployeesDataModel)tempDataModel.Clone(); } else if (dataModel.GetType() == typeof(ManorDataModel)) { ManorDataModel tempDataModel = (ManorDataModel)dataModel; _fiefService.ManorList[index] = (ManorDataModel)tempDataModel.Clone(); } else if (dataModel.GetType() == typeof(BoatbuildingDataModel)) { BoatbuildingDataModel tempDataModel = (BoatbuildingDataModel)dataModel; _fiefService.BoatbuildingList[index] = (BoatbuildingDataModel)tempDataModel.Clone(); } else if (dataModel.GetType() == typeof(ExpensesDataModel)) { ExpensesDataModel tempDataModel = (ExpensesDataModel)dataModel; _fiefService.ExpensesList[index] = (ExpensesDataModel)tempDataModel.Clone(); } else if (dataModel.GetType() == typeof(StewardsDataModel)) { StewardsDataModel tempDataModel = (StewardsDataModel)dataModel; for (int x = 0; x < _fiefService.StewardsList.Count; x++) { _fiefService.StewardsList[x] = (StewardsDataModel)tempDataModel.Clone(); } } else if (dataModel.GetType() == typeof(SubsidiaryDataModel)) { SubsidiaryDataModel tempDataModel = (SubsidiaryDataModel)dataModel; _fiefService.SubsidiaryList[index] = (SubsidiaryDataModel)tempDataModel.Clone(); } else if (dataModel.GetType() == typeof(IncomeDataModel)) { IncomeDataModel tempDataModel = (IncomeDataModel)dataModel; _fiefService.IncomeList[index] = (IncomeDataModel)tempDataModel.Clone(); } else if (dataModel.GetType() == typeof(BuildingsDataModel)) { BuildingsDataModel tempDataModel = (BuildingsDataModel)dataModel; _fiefService.BuildingsList[index] = (BuildingsDataModel)tempDataModel.Clone(); } else if (dataModel.GetType() == typeof(WeatherDataModel)) { WeatherDataModel tempDataModel = (WeatherDataModel)dataModel; _fiefService.WeatherList[index] = (WeatherDataModel)tempDataModel.Clone(); } else if (dataModel.GetType() == typeof(MinesDataModel)) { MinesDataModel tempDataModel = (MinesDataModel)dataModel; _fiefService.MinesList[index] = (MinesDataModel)tempDataModel.Clone(); } else if (dataModel.GetType() == typeof(PortDataModel)) { PortDataModel tempDataModel = (PortDataModel)dataModel; _fiefService.PortsList[index] = (PortDataModel)tempDataModel.Clone(); } else if (dataModel.GetType() == typeof(TradeDataModel)) { TradeDataModel tempDataModel = (TradeDataModel)dataModel; _fiefService.TradeList[index] = (TradeDataModel)tempDataModel.Clone(); } else { Console.WriteLine("ERROR!"); } } }