private bool TryProcessSelect() { if (this.VerifyAndPopulateData()) { var s = this._data.Source.Model; var t = this._data.Target.Model; var current = CombatManager.Instance.GetCurrentlyActing(); var pathSearch = new PathSearch(); var path = pathSearch.GetPath(s, t, current.Proxy.GetModel()); if (path != null) { VMapCombatController.Instance.DecoratePath(path); return(true); } } return(false); }
private bool VerifyAndPopulateData() { if (this._data == null) { return(false); } if (this._data.Char == null) { this._data.Char = CombatManager.Instance.GetCurrentlyActing(); } var bob = this._data.Char.GameHandle.GetComponent <SBob>(); if (bob != null) { bob.Reset(); } this.AddCallback(this.AddBob); if (this._data.Target == null) { return(false); } if (this._data.Source == null) { this._data.Source = this._data.Char.Tile; } var s = this._data.Source.Model; var t = this._data.Target.Model; var pathSearch = new PathSearch(); this._data.TargetPath = pathSearch.GetPath(s, t, this._data.Char.Proxy.GetModel()); if (this._data.TargetPath == null) { return(false); } var model = this._data.TargetPath.GetFirstTile() as MTile; if (model == null) { return(false); } this._current = model.Controller; return(true); }