public void AbilityAction(Ability ability) { Status = WaitingStatus.ABILITY; AbilityCastTargeter targeter = new AbilityCastTargeter(ability, gui.GUIState, world, this, config); graphics.OnAbilityAction(targeter); StartCoroutine(targeter.TargetAndCastAbilityCoroutine()); }
public void Select() { gui.GUIState.SetState(GUIStateManager.UNIT); AllowHovering(false); IsSelected = true; Status = WaitingStatus.NONE; panel.SetSelectedUnit(this); graphics.OnSelect(); }
private async Task OnTransferStatusUpdate( BackgroundTransferRequest transfer, Action <BackgroundTransferRequest> onFinished) { switch (transfer.TransferStatus) { // TransferStatus.Completed might be reported more than once for the same transfer case TransferStatus.Completed: await OnTransferComplete(transfer); onFinished(transfer); break; default: WaitingStatus.Update(transfer.TransferStatus); break; } }
/// <summary> /// Initializes the existing transfers with the default status update handlers. /// /// Note that while status update handlers are already added as the transfer request is created, /// they are only valid until the user closes the app. /// /// We therefore need to re-install them at launch if the user has /// closed the app while there are transfer(s) in progress. /// </summary> private async Task InstallStatusCallbacks() { WaitingStatus.Reset(); await UpdateTransfersList(); var reqs = TransferRequests; foreach (var transfer in reqs) { transfer.TransferStatusChanged += (sender, e) => { OnTransferStatusUpdate(e.Request); OnDownloadStatusUpdate(transfer); }; transfer.TransferProgressChanged += (sender, e) => { OnDownloadStatusUpdate(transfer); }; // removes completed transfers await OnTransferStatusUpdate(transfer); } initComplete = true; }
public void UpdateProps() { WaitingStatus.UpdateProps(); OnPropertyChanged("IsNotWaitingAndNoMessages"); }
public void AttackAction() { Status = WaitingStatus.ATTACK; graphics.OnAttackAction(unitEntity.Combat.GetAttackables()); }
public void MoveAction() { Status = WaitingStatus.MOVEMENT; graphics.OnMoveAction(unitEntity.Movement.GetMoveables().Reachables); }