/* #endregion */ /* #region ---- Accumulated AP-Cost (Calculation before action) --------------------------- */ public void UpdateAccAPCost(int accCost) { MatchPlayer activePlayer = MatchManager.MatchPlayerManager.CurrentActivePlayer; DrawPathLine drawPathLine = MatchManager.PitchGrid.PathFinding.DrawPathLine; if (drawPathLine.AccCostReset) { apCost.text = ""; } else { if (activePlayer.PlayerMode == PlayerMode.Move) { //TODO: Why accCost != 0 when calculating AP-Cost in Move Mode??? if (accCost <= activePlayer.CurrentActionPoints && accCost != 0) { apCost.text = $"-{accCost.ToString()}"; } else { apCost.text = "Not enough AP!"; } } else { if (accCost <= activePlayer.CurrentActionPoints) { apCost.text = $"-{accCost.ToString()}"; } else { apCost.text = "Not enough AP!"; } } } }
/* #endregion */ /* #endregion */ /* ======================================================================================== */ /* #region ==== CONSTRUCTOR =============================================================== */ public PathFinding() { this.MatchManager = MatchManager.Instance; this.DrawPathLine = new DrawPathLine(); }