void Start() { FPMapper.Initialise(); _selectedCountry = null; fileName = PlayerPrefs.GetString("ID"); _coreDataManager = new CoreDataManager(); _coreDataManager.setNewCoreDataModel(FPRepository.LoadJSONProfile(fileName + ".json", "Profiles/", true)); _newsDataManager = new NewsDataManager(); _newsDataManager.setNewsDataModelJSON(FPRepository.LoadFile("News.json", "Config/")); NewsGenerator newGen = this.gameObject.AddComponent <NewsGenerator>(); newGen.newsData = _newsDataManager; newGen.countries = _coreDataManager.GetListCountriesList().ToArray(); List <NationDataModel> models = _coreDataManager.GetCountries(); foreach (NationDataModel ndm in models) { GameObject country = new GameObject(ndm.Name); country.transform.parent = this.transform; country.tag = "Country"; FPMapper.MapCountry(country, ndm); }
public BWDataManager(AGGameIndex gameIndex, int categoryIndex, string file) { if (gameIndex == AGGameIndex.k_Beeworld_NumberSequence) { currentCategoryID = 179; currentCategory = "Number Sequence"; } else { if (categoryIndex == 0) { currentCategoryID = 178; currentCategory = "Counting Up From"; } else { currentCategoryID = 180; currentCategory = "Counting Down From"; } } CategoriesData data = CategoriesData.getSharedData(file); Hashtable numberSequenceData = data.getGameDataForIndex(gameIndex); ArrayList availableCat = (ArrayList)numberSequenceData["availableCategories"]; allLevels = (Hashtable)availableCat[categoryIndex]; #if (!MAC_PLATFORM) coreManager = new CoreDataManager(currentCategoryID); allCategoriesCoreData = coreManager.getResultDict(); currentLevel = coreManager.getCurrentLevel(); #endif fetchLevelData(); }
public BWDataManager (AGGameIndex gameIndex, int categoryIndex, string file) { if(gameIndex == AGGameIndex.k_Beeworld_NumberSequence) { currentCategoryID = 179; currentCategory = "Number Sequence"; } else { if(categoryIndex == 0) { currentCategoryID = 178; currentCategory = "Counting Up From"; } else { currentCategoryID = 180; currentCategory = "Counting Down From"; } } CategoriesData data = CategoriesData.getSharedData(file); Hashtable numberSequenceData = data.getGameDataForIndex(gameIndex); ArrayList availableCat = (ArrayList)numberSequenceData["availableCategories"]; allLevels = (Hashtable)availableCat[categoryIndex]; #if (!MAC_PLATFORM) coreManager = new CoreDataManager(currentCategoryID); allCategoriesCoreData = coreManager.getResultDict(); currentLevel = coreManager.getCurrentLevel(); #endif fetchLevelData(); }
public MADataManager(AGGameIndex gameIndex, int categoryIndex, string file) { CategoriesData data = CategoriesData.getSharedData(file); Hashtable maData = data.getGameDataForIndex(gameIndex); allLevels = (Hashtable)maData["allLevels"]; #if (!MAC_PLATFORM) coreManager = new CoreDataManager(currentCategoryID); allCategoriesCoreData = coreManager.getResultDict(); currentLevel = coreManager.getCurrentLevel(); #endif fetchLevelData(); }
// Use this for initialization void Start() { // Saving the players enetered data in a string PlayerID = PlayerPrefs.GetString("ID"); Debug.Log(PlayerID); PlayerCountry = PlayerPrefs.GetString("Country"); Debug.Log(PlayerCountry); Score = Standings.GetScore(); Player = GameObject.Find(PlayerCountry); CoreDataManager PlayerDataManger = new CoreDataManager(); List <NationDataModel> nationList = new List <NationDataModel>(); nationList = PlayerDataManger.GetCountries(); //List<GameObject> gos = GameObject.FindGameObjectsWithTag("Country"); //still cant get it to pass the countrys data into the script foreach (GameObject go in GameObject.FindGameObjectsWithTag("Country")) { Debug.Log("Entering player Data"); NationDataModel ndm = new NationDataModel(); ndm.Name = go.GetComponent <CountryStanding>().Name; ndm.Population = go.GetComponent <CountryStanding>().Population; ndm.MapPosition = go.GetComponent <CountryStanding>().MapPosition; ndm.Budget = go.GetComponent <CountryStanding>().Budget; ndm.Allies = go.GetComponent <CountryStanding>().Allies; ndm.Enemies = go.GetComponent <CountryStanding>().Enemies; ndm.TradingPartners = go.GetComponent <CountryStanding>().TradingPartners; nationList.Add(ndm); } foreach (NationDataModel nation in nationList) { if (nation.Name == Player.name) { PlayerBudget = nation.Budget; PlayerPopulation = nation.Population; PlayerAllies = nation.Allies; PlayerTradingPartners = nation.TradingPartners; PlayerEnemies = nation.Enemies; Debug.Log(PlayerBudget); Debug.Log(PlayerPopulation); } } }
public JW_DataManager(AGGameIndex gIndex, int categoryIndex, string file) { _CategoryIndex = categoryIndex; gameIndex = (int)gIndex; getSkillIDForGame(gIndex); CategoriesData data = CategoriesData.getSharedData(file); Hashtable shapesData = data.getGameDataForIndex(gIndex); ArrayList availableCat = (ArrayList)shapesData["skills"]; allLevels = (Hashtable)availableCat[categoryIndex]; //----------- Core Communication #if (!MAC_PLATFORM) coreManager = new CoreDataManager(currentSkillID); allCategoriesCoreData = coreManager.getResultDict(); currentLevel = coreManager.getCurrentLevel(); #endif }
public void UpdateAll(DataTable dtMerger) { try { ISingleTable pl = CoreDataManager.GetEntityTbl(strEntityName);; DataSet ds = new DataSet(); ds.Tables.Add(pl.GetDataTable()); ds.Tables[0].TableName = "Users"; dtMerger.TableName = "Users"; ds.Merge(dtMerger, false, MissingSchemaAction.Ignore); pl.UpdateDataTable(ds.Tables[0]); } catch (Exception ex) { throw ex; } }
void Awake() { if (!coreDataManager) { coreDataManager = FindObjectOfType <CoreDataManager>(); if (coreDataManager) { DontDestroyOnLoad(gameObject); } } if (instance == null) { coreDataManager = this; DontDestroyOnLoad(gameObject); } else { if (instance != this) { Destroy(gameObject); } } }
public static void addDummyCategoryData() { int [] categoryIDs = { 169, 178, 179, 180, 51, 132, 32, 131 }; for (int i = 0; i < categoryIDs.Length; i++) { CoreDataManager coreManager = new CoreDataManager(categoryIDs[i]); Hashtable allCategoriesCoreData = coreManager.getResultDict(); foreach (string key in allCategoriesCoreData.Keys) { Hashtable objDict = (Hashtable)allCategoriesCoreData[key]; int attempted = AGGameState.GetAsInt(objDict["attempted"]); int solved = AGGameState.GetAsInt(objDict["solved"]); objDict["attempted"] = attempted + UnityEngine.Random.Range(10, 13); objDict["solved"] = solved + UnityEngine.Random.Range(6, 10); } coreManager.setResultDict(allCategoriesCoreData); coreManager.saveManager(); } }
public JW_DataManager(AGGameIndex gIndex, int categoryIndex, string file) { _CategoryIndex=categoryIndex; gameIndex=(int)gIndex; getSkillIDForGame(gIndex); CategoriesData data = CategoriesData.getSharedData(file); Hashtable shapesData = data.getGameDataForIndex(gIndex); ArrayList availableCat = (ArrayList)shapesData["skills"]; allLevels = (Hashtable)availableCat[categoryIndex]; //----------- Core Communication #if (!MAC_PLATFORM) coreManager = new CoreDataManager(currentSkillID); allCategoriesCoreData = coreManager.getResultDict(); currentLevel = coreManager.getCurrentLevel(); #endif }