/// <summary>Update Enemy TurnMeter and Sort It</int></summary> /// UPDATED 01/07/2020 private void UpdateEnemyTurnMeter(int _PlayingUnitID, BattleState _battleState) { foreach (var UnitEnemyCollection in _IACollection) { //_enemyUnitTurnmeter[UnitEnemyCollection.Key].turnMeter += _enemyCollection[UnitEnemyCollection.Key].UnitVelocity; _IAUnitTurnmeter[UnitEnemyCollection.Key] += (_IACollection[UnitEnemyCollection.Key].UnitVelocity / ((float)_IAUnitTurnmeter.Count + (float)_playerUnitTurnmeter.Count)); if (_battleState.Equals(BattleState.IA_TURN)) { // If it's a enemy Turn & the Unit is the Current Playing Unit if (UnitEnemyCollection.Key.Equals(_PlayingUnitID)) { // Decrease the turnMeter by the turnMeterMaxValues. //_playerCollection[UnitEnemyCollection.Key].turnMeter -= TurnMeterMaxValue; _IAUnitTurnmeter[UnitEnemyCollection.Key] -= TurnMeterMaxValue; } currentBattleState = BattleState.UPDATE_TURN; } } //Sort my new _enemyUnitTurnmeter by Hiest Turnmeter _IAUnitTurnmeter = GetUnitsSortedByTurnMeter(_IAUnitTurnmeter); }