public void UpdateView() { _quantityField.text = _model.GetTotalQty().ToString(); _healthField.text = _model.GetTotalHealth().ToString(); _mirrorImageField.gameObject.SetActive(_model.IsAffectedBy("Mirror Image")); _confusionField.gameObject.SetActive(_model.IsAffectedBy("Confusion")); _magicShieldField.gameObject.SetActive(_model.IsAffectedBy("Magic Shield")); _stoneSkinField.gameObject.SetActive(_model.IsAffectedBy("Stone Skin")); }
/// <summary> /// Get the defending unit stack /// </summary> /// <returns>Defending unit stack</returns> public UnitStack SelectDefendingStack() { if (_currentTarget != null && _currentTarget.GetTotalHealth() > 0) { return(_currentTarget); } UnitStack result = null; if (_currentAttacks != null && _currentAttacks.Count > 0) { if (_attackerRollResults.Contains(_currentAttacks) && !_isDefenderPC) { result = _defendingTactician.SelectDefendingUnitStack(_defenders, _currentAttacks.GetUnitStack(), _currentPhase - 1); } if (_defenderRollResults.Contains(_currentAttacks) && !_isAttackerPC) { result = _attackingTactician.SelectDefendingUnitStack(_attackers, _currentAttacks.GetUnitStack(), _currentPhase - 1); } _currentTarget = result; } return(result); }