private void OnMovementFinished(bool s) { RemoveEvents(); if (StartCell == EndCell) { s = true; } MovementFinished?.Invoke(this, new CellMovementEventArgs(StartCell, EndCell, s, _path.Cells.Count + 1)); }
void InvokeOnMovementFinished() { try { MovementFinished?.Invoke(this); } catch (Exception e) { Urho.IO.Log.Write(LogLevel.Debug, $"There was an unexpected exception during the invocation of {nameof(MovementFinished)}: {e.Message}"); } }
public async void NotifyMovementFinished(int oldPosition, int newPosition) { MovementFinished?.Invoke(this, null); try { await _authSource.CommitRanking(); } catch { // Cannot revert, keep going } }
public async void NotifyMovementFinished() { MovementFinished?.Invoke(this, null); try { await _authSource.CommitRanking(); } catch (Exception e) { // Cannot revert, keep going Logger.Error(e); } }
public void CalculateTargets(MovementFinished e) { var targetsAvailable = new RangedTargetsAvailable { Targets = GameWorld.LivingCharacters .Where(x => x != GameWorld.CurrentCharacter && CanShoot(GameWorld.CurrentCharacter, x)) .Select(x => new Target { Character = x, CoverToThem = new ShotCalculation(GameWorld.CurrentCharacter.CurrentTile, x.CurrentTile).GetBestShot(), CoverFromThem = CanShoot(x, GameWorld.CurrentCharacter) ? new ShotCalculation(x.CurrentTile, GameWorld.CurrentCharacter.CurrentTile).GetBestShot() : new ShotCoverInfo(new List <CoverProvided>()) }).ToList() }; EventQueue.Instance.Add(targetsAvailable); }
public void Init(int startRotation, OffsetCoord?startPosition = null) { OnMovementFinished = new MovementFinished(); OnPieceClicked = new PieceClicked(); GameHexes = new List <GameHex>(GetComponentsInChildren <GameHex>()); foreach (GameHex gHex in GameHexes) { gHex.OnHexMouseDown += OnHexMouseDown; gHex.layer = 1; gHex.UpdatePosition(); } FixCorners(); SetColourInner(InnerActive); SetColourOuter(OuterSelected); targetRotation = startRotation; LockRotation(); Point = Layout.HexToPixel(OffsetCoord.RoffsetToCube(OffsetCoord.EVEN, startPosition.GetValueOrDefault())); }
private void OnMovementFinished(bool s) { _account.Character.Status = CharacterStatus.None; RemoveEvents(); MovementFinished?.Invoke(this, new CellMovementEventArgs(StartCell, EndCell, s)); }
private void OnMovementFinished(bool success) { _currentPath = null; _neighbourMapId = 0; MovementFinished?.Invoke(success); }
public void OnMovementFinished() { MovementFinished?.Invoke(this, EventArgs.Empty); }
private void OnMovementFinished(MovementFinished obj) => _currentPathTransforms = new List <Transform2>(0);
public async void NotifyMovementFinished(int oldPosition, int newPosition) { MovementFinished?.Invoke(this, null); await _authSource.CommitRanking(); }
public void OnMovementFinished() { MovementFinished?.Invoke(this, null); }