Beispiel #1
0
 private void OnMovementFinished(bool s)
 {
     RemoveEvents();
     if (StartCell == EndCell)
     {
         s = true;
     }
     MovementFinished?.Invoke(this, new CellMovementEventArgs(StartCell, EndCell, s, _path.Cells.Count + 1));
 }
Beispiel #2
0
 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
            }
        }
Beispiel #4
0
        public async void NotifyMovementFinished()
        {
            MovementFinished?.Invoke(this, null);

            try
            {
                await _authSource.CommitRanking();
            }
            catch (Exception e)
            {
                // Cannot revert, keep going
                Logger.Error(e);
            }
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
    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()));
    }
Beispiel #7
0
 private void OnMovementFinished(bool s)
 {
     _account.Character.Status = CharacterStatus.None;
     RemoveEvents();
     MovementFinished?.Invoke(this, new CellMovementEventArgs(StartCell, EndCell, s));
 }
Beispiel #8
0
 private void OnMovementFinished(bool success)
 {
     _currentPath    = null;
     _neighbourMapId = 0;
     MovementFinished?.Invoke(success);
 }
Beispiel #9
0
 public void OnMovementFinished()
 {
     MovementFinished?.Invoke(this, EventArgs.Empty);
 }
Beispiel #10
0
 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);
 }