public void UpdateChance() { //Get GSM speed = gameStatManager.GetSpeed(); globalHashPower = gameStatManager.GetGlobalHashPower(); sharedReward = gameStatManager.GetSharedReward(); dailyElectricity = gameStatManager.GetDailyElectricity(); currentPool = gameStatManager.GetCurrentPool(); bitcoinPrice = gameStatManager.GetBitcoinValue(); if (currentPool == -1) { chance = speed / globalHashPower; } else { chance = (PoolList.GetPool(currentPool).hashrate + speed) / globalHashPower; } expectedEarning = (chance * sharedReward * bitcoinPrice) * 144 - (dailyElectricity * electricityManager.unitCost); //To GSM gameStatManager.SetChance(chance); gameStatManager.SetExpectedEarning(expectedEarning); }
private void ShowPoolData() { Pool pool = PoolList.GetPool(currentPool); yesPanel.transform.Find("MiningPoolName").GetComponent <Text>().text = pool.poolName; float totalHashrate = pool.hashrate + gameStatManager.GetSpeed(); yesPanel.transform.Find("MainPanel/ChanceValue").GetComponent <Text>().text = ((totalHashrate / gameStatManager.GetGlobalHashPower()) * 100).ToString("N2") + "%"; yesPanel.transform.Find("MainPanel/HashrateValue").GetComponent <Text>().text = (pool.hashrate + gameStatManager.GetSpeed()).ToString(); yesPanel.transform.Find("MainPanel/MemberValue").GetComponent <Text>().text = pool.member.ToString(); }
public void UpdateSharedReward() { if (miningInfoPanel.activeSelf) { currentPool = gameStatManager.GetCurrentPool(); if (currentPool != -1) { sharedReward = gameStatManager.GetBlockReward() * (gameStatManager.GetSpeed() / PoolList.GetPool(currentPool).hashrate); } else { sharedReward = gameStatManager.GetBlockReward(); } gameStatManager.SetSharedReward(sharedReward); } }