// コンストラクタ public Character(Point nowPos, Size scope) { // キャラクターのステータスの初期化 charaState = new CharacterStatus(); // アクションステータスの初期化 actionState = ActionStatus.FALL; // キャラクターイメージの初期化 imageGroup = new CharaActionImage(charaState); // キャラクターの移動インスタンスの初期化 charaMove = new CharaMove(this,scope); // 位置の設定 this.position = nowPos; // アクションカウンターの初期化 this.actionCounter = this.ACT_COUNTER_MAX; // タイマーの初期化 timer = new Timers.StatusTimer(); // タイマーのイベントハンドラの設定 timer.Tick += new EventHandler(timerEvent); // タイマーのスタート timer.Enabled = true; }
public TrackingItem() { this.totalItemsReceived = 0; this.totalItemsSent = 0; this.deferredApproval = 0; this.description = string.Empty; this.status = ActionStatus.NoExceptionTaken; }
public void StatusUpdateOnExeption(int queueId, ActionStatus statusId, string errorMessage) { Execute("[dbo].[Test_ActionStatusUpdateOnFailure]", new { errorMessage, queueId, statusId }); }
public void Start_ProgramStateStartedOrIdleBasedOnValveManagerStart(ActionStatus actionStatus, ProgramState expectedState) { //Arrange valveManagerMock.Setup(x => x.Start(testSettings, valveType)).Returns(actionStatus); //Act testerService.Start(testSettings, valveType); //Assert Assert.AreEqual(expectedState, testerService.State); }
public ActionResponse(ActionStatus status, object response, Exception exception, string friendlyMessageCode) { this.Status = status; this.Body = response; this.ExceptionDetail.ExceptionCaught = exception; this.ExceptionDetail.FriendlyMessageCode = friendlyMessageCode; this.ExceptionDetail.AdditionalDetailsErrorMessage = GetInnerExceptionText(exception); }
protected HttpResponseMessage CreateResponseError(string message, ActionStatus status, object model = null) { return(Request.CreateResponse <ApiActionOutput>(HttpStatusCode.OK, new ApiActionOutput { Status = Status.Failed, Message = message, result = model })); }
public MessageItem Add(Exception exception, ActionStatus severity) { var item = new MessageItem(exception); item.Exception = exception; setStatus(item.Severity); this.Add(item); return(item); }
/// <summary> /// parse ActionStatus enum into WebResult /// </summary> /// <param name="status">status of action</param> /// <returns>WebResult</returns> protected ActionResult WebResultOk(ActionStatus status) { return(Ok(new WebResult <bool> { Success = status == ActionStatus.Success, Message = EnumHelper <ActionStatus> .GetDisplayValue(status), Value = false })); }
public bool strafe(ActionStatus actionStatus) { FPSLikeMovement(5f, 10f); if (Input.GetButton("Fire1")) { return(gun.fire()); } return(true); }
public TrackingItem(SpecificationSection specSection) { this.specSection = specSection; this.totalItemsReceived = 0; this.totalItemsSent = 0; this.deferredApproval = 0; this.description = string.Empty; this.status = ActionStatus.NoExceptionTaken; }
/// <summary> /// 请求发呆 /// </summary> /// <returns></returns> public behaviac.EBTStatus Idle() { if (curActionStatus != ActionStatus.StopAndDoingNothing) { curActionStatus = ActionStatus.StopAndDoingNothing; MgrCenter.Instance.SendMsg(Msgs.GetMsgInt((ushort)SoilderFightEvent.SoilderIdleClientRequest, this.Id)); } return(behaviac.EBTStatus.BT_SUCCESS); }
/// <summary> /// Triggered when the status of a bound action changes. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="actionStatus">New status for the action.</param> private void OnBoundActionStatusChanged(object sender, ActionStatus actionStatus) { if (sender is Action action) { if (actionStatus == ActionStatus.Failed || actionStatus == ActionStatus.Success) { action.OnStatusChanged -= OnBoundActionStatusChanged; if (!IsBusy) { // all current actions have finished int failedCount = this.currentActions.Count(a => a.Status == ActionStatus.Failed); Log.WriteLine(LogLevel.Verbose, $"all current actions have been completed - {failedCount} have failed"); if (failedCount == this.currentActions.Count) { // all failed Log.WriteLine(LogLevel.Error, "all actions have failed"); Application.TrayIcon.SetTimedIndicator(IndicatorStatus.Warning); //Application.Hud.DisplayTidbit(TidbitStatus.Error, Resources.ActionStatus_Tidbit_AllFailed); } else if (failedCount > 0) { // some failed Log.WriteLine(LogLevel.Warning, "some actions have failed"); Application.TrayIcon.SetTimedIndicator(IndicatorStatus.Warning); //Application.Hud.DisplayTidbit(TidbitStatus.Warning, Resources.ActionStatus_Tidbit_SomeFailed); } else { // all succeeded Log.WriteLine(LogLevel.Informational, "all actions have succeeded"); Application.TrayIcon.SetTimedIndicator(IndicatorStatus.Success); /*Application.Hud.DisplayTidbit(TidbitStatus.Success, action.Codec is IStillImageCodec * ? Resources.ActionStatus_Tidbit_AllSucceeded_Screenshot * : Resources.ActionStatus_Tidbit_AllSucceeded_Recording);*/ } this.actionHistory.AddRange(this.currentActions); this.currentActions.Clear(); try { // update entries for the action dialog var dialog = (ActionDialog)System.Windows.Forms.Application.OpenForms.Cast <Form>() .First(f => f is ActionDialog); dialog.ReplaceActions(this.actionHistory); dialog.Focus(); dialog.BringToFront(); } catch { /* no action dialog is open */ } } } } }
/// <summary> /// 获得一个动作 /// </summary> /// <param name="gameStatus"></param> /// <returns></returns> public static void GetAction(ActionStatus gameStatus) { String Action = String.Empty; PublicInfo PlayInfo = gameStatus.AllRole.MyPublicInfo; PrivateInfo PlaySelfInfo = gameStatus.AllRole.MyPrivateInfo; List <String> Result = new List <string>(); //优先使用技能 if (PlayInfo.IsHeroSkillEnable(true)) { //召唤 if (PlayInfo.Hero.HeroSkill.FirstAbilityDefine.MainAbilityDefine.TrueAtomicEffect.AtomicEffectType == Effect.AtomicEffectDefine.AtomicEffectEnum.召唤 && PlayInfo.BattleField.MinionCount != SystemManager.MaxMinionCount) { gameStatus.Interrupt.ActionCard = new MinimizeBattleInfo.HandCardInfo(); gameStatus.Interrupt.ActionCard.Init(PlayInfo.Hero.HeroSkill); gameStatus.ActionName = "USEHEROSKILL"; gameStatus.Interrupt.Step = 1; gameStatus.Interrupt.ActionName = "SPELL"; PlayInfo.crystal.CurrentRemainPoint -= PlayInfo.Hero.HeroSkill.使用成本; PlayInfo.Hero.IsUsedHeroAbility = true; RunAction.StartActionCS(gameStatus, PlayInfo.Hero.HeroSkill.序列号, new string[] { }); gameStatus.Interrupt.ActionName = "SPELL"; return; } } //能上场的随从都上场 int HandCardIndex = HasBattleMinion(gameStatus); if (HandCardIndex != -1) { int newPos = PlayInfo.BattleField.MinionCount + 1; var card = PlaySelfInfo.handCards[HandCardIndex]; RunAction.StartActionCS(gameStatus, card.序列号, new string[] { newPos.ToString() }); PlayInfo.crystal.CurrentRemainPoint -= card.使用成本; PlaySelfInfo.RemoveUsedCard(card.序列号); PlayInfo.HandCardCount = PlaySelfInfo.handCards.Count; gameStatus.Interrupt.ActionCard = new MinimizeBattleInfo.HandCardInfo(); gameStatus.Interrupt.ActionCard.Init(card); gameStatus.Interrupt.ActionName = "MINION"; return; } //能攻击的随从都攻击,优先攻击英雄 int AttackPos = HasAttackMinion(gameStatus); if (AttackPos != -1) { int BeAttackedPos = GetAttackTarget(gameStatus); RunAction.Fight(gameStatus, AttackPos, BeAttackedPos, true); gameStatus.Interrupt.ActionName = "FIGHT"; gameStatus.Interrupt.ExternalInfo = AttackPos.ToString() + BeAttackedPos.ToString(); return; } gameStatus.Interrupt.ActionName = ActionCode.strEndTurn; }
protected void CheckIfAnyIdIsSelected(Guid[] selectedIds) { if (selectedIds != null && selectedIds.Length > 0) { return; } Status = ActionStatus.NoIdsSelected; throw new Exception("Nie wybrano żadnych znajomych"); }
public void Start_returnsActionStatusOkIfValveTypeExists(string valveTypeTxt, ActionStatus expectedActionStatus) { //Arrange valveManager.Initialize(4); //Act ActionStatus returnActionStatus = valveManager.Start(testSettings, valveTypeTxt); //Assert Assert.AreEqual(expectedActionStatus, returnActionStatus); }
public ActionResponse(ActionStatus status, object response, string friendlyErrorMessageCode) { if (status == ActionStatus.Failure) { this.ExceptionDetail.FriendlyMessageCode = friendlyErrorMessageCode; } this.Status = status; this.Body = JsonUtility.GetJObjectFromObject(response); }
public Sequence(GameObject gameObject, PlayerInfo playerInfo, IAction[] actions) { this.m_AllActions = actions; for (int i = 0; i < this.m_AllActions.Length; i++) { this.m_AllActions[i].Initialize(gameObject, playerInfo); } this.m_Status = ActionStatus.Inactive; this.m_ActionStatus = ActionStatus.Inactive; }
public ActionReplyMessageItem(Exception ex, ActionStatus severity) { Exception = new LogException(ex); if (ex != null) { MessageText = ex.Message; } Severity = severity; }
/// <summary> /// Ends the action and sets its status to <see cref="F:Crystal.ActionStatus.Success"/>. /// </summary> /// <param name="context">The context.</param> protected void EndInSuccess(IContext context) { if (ActionStatus != ActionStatus.Running) { return; } ActionStatus = ActionStatus.Success; FinalizeAction(context); }
protected void OnStatusChange(ActionStatus previousStatus) // Rajouter un check du statut précédent ? { if (PostStatusChangeCheck(previousStatus)) { if (StatusChangeEvent != null) { StatusChangeEvent(this); } } }
public void End(ActionStatus status) { if (_status != ActionStatus.Running) { return; } _status = status; OnEnd(); Ended?.Invoke(this); }
/// <summary> /// Ends the action and sets its status to <see cref="F:Crystal.ActionStatus.Failure"/>. /// </summary> /// <param name="context">The context.</param> protected void EndInFailure(IContext context) { if (ActionStatus != ActionStatus.Running) { return; } ActionStatus = ActionStatus.Failure; FinalizeAction(context); }
public ActionResult Create(ActionStatus? status) { ViewBag.Message = status == ActionStatus.Success ? "Added successfully!" : status == ActionStatus.Failure ? "An error occurred while adding!" : ""; ViewBag.Status = status; return View(); }
} // NewAsync private ActionMetaData NewSync( string sActionName, ActionStatus status = ActionStatus.InProgress, string comment = null, int?nCustomerID = null, int?nUserID = null ) { return(CreateActionMetaData(sActionName, true, status, comment, nCustomerID, nUserID)); } // NewSync
public void CheckIfUserIsDifferentThanLogged(UserToLoginViewModel loggedUser, User friend, ProjectDbContext db) { var isUserSameAsLogged = friend.Id == loggedUser.Id; if (isUserSameAsLogged) { Status = ActionStatus.UserIsSameAsLogged; throw new Exception("Nie możesz manipulować kontem na które jesteś zalogowany"); } }
//Starts the task behavior public void Start() { this.m_Actions = this.m_AllActions.Where(x => x.isActiveAndEnabled).ToArray(); for (int i = 0; i < this.m_Actions.Length; i++) { this.m_Actions[i].OnSequenceStart(); } this.m_ActionIndex = 0; this.m_Status = ActionStatus.Running; }
protected void CheckIfNotificationNotEmpty(string notificationTitle, string notificationContent) { if (!string.IsNullOrWhiteSpace(notificationTitle) && !string.IsNullOrWhiteSpace(notificationContent)) { return; } Status = ActionStatus.Failure; throw new Exception("Powiadomienie nie zawiera żadnej treści do wysłania"); }
protected void CheckIfAllUsersAreDifferentThanLogged(User loggedUser, User[] selectedusers, ProjectDbContext db) { if (selectedusers.All(u => u.Id != loggedUser.Id)) { return; } Status = ActionStatus.UserIsSameAsLogged; throw new Exception("Nie możesz manipulować kontem na które jesteś zalogowany"); }
//pacifism private async Task <ActionResponse> askForActionAsync(ApiPlayer player, ActionStatus actionStatus) { var actionRequest = new ActionRequest { Status = actionStatus }; return(await(await player.HttpClient.PostAsJsonAsync("/beginAction", actionRequest)) .EnsureSuccessStatusCode() .Content.ReadFromJsonAsync <ActionResponse>()); }
/// <summary> /// TargetSelect /// </summary> /// <param name="option"></param> /// <param name="_actionStatus"></param> public TargetSelect(CardUtility.位置选择用参数结构体 option, ActionStatus _actionStatus) { InitializeComponent(); SelectOption = option; actionStatus = _actionStatus; Position.位置 = -1; ctlUsageCard.CardInfo = GameManager.MyClientManager.CurrentActiveCard; ctlUsageCard.Enabled = false; ctlUsageCard.Visible = true; }
bool CanExecute() { if (InCooldown) { ActionStatus = ActionStatus.Failure; return(false); } return(true); }
public void AttackAnimation() { if (this.point.X >= stopPoint - charaSize.Width) { this.charaState.isAttackAnimation = true; this.charaState.isWalk = false; } this.charaState.isAttack = !this.charaState.isAttack; actionstate = pm.nextActionPattern(actionstate, charaState.isWalk); }
public ActionResponse(ActionStatus status, object response, bool isResponseSensitive = false) { this.IsResponseSensitive = isResponseSensitive; if (status == ActionStatus.Failure || status == ActionStatus.FailureExpected) { this.ExceptionDetail.FriendlyMessageCode = DefaultErrorCodes.DefaultErrorCode; } this.Status = status; this.Body = response; }
public ActionResult Create(ActionStatus? status) { ViewBag.Message = status == ActionStatus.Success ? "Added successfully!" : status == ActionStatus.Failure ? "An error occurred while adding!" : ""; ViewBag.Status = status; List<string> titles = new List<string> { "Mr", "Mrs", "Miss", "Ms", "Dr", "Eng", "Prof", "Rev" }; ViewBag.Titles = new SelectList(titles); ViewBag.Countries = new SelectList(GetAllCountries()); return View(); }
public ActionResult Modify(int id, ActionStatus? status) { ViewBag.Message = status == ActionStatus.Success ? "Updated successfully!" : status == ActionStatus.Failure ? "An error occurred while updating!" : ""; ViewBag.Status = status; NewsModel news = newsBLL.GetNews(id); news.News = HttpUtility.HtmlDecode(news.News); return View(news); }
public ActionResult Modify(int id, ActionStatus? status) { ViewBag.Message = status == ActionStatus.Success ? "Updated successfully!" : status == ActionStatus.Failure ? "An error occurred while updating!" : ""; ViewBag.Status = status; ViewBag.ProjectStatusSelectList = GetProjectStatusSelectList(); ProjectModel project = projectBLL.GetProject(id); project.Description = HttpUtility.HtmlDecode(project.Description); return View(project); }
public ActionResult Modify(int id, ActionStatus? status) { ViewBag.Message = status == ActionStatus.Success ? "Updated successfully!" : status == ActionStatus.Failure ? "An error occurred while updating!" : ""; ViewBag.Status = status; EventModel evnt = eventsBLL.GetEvent(id); evnt.Description = HttpUtility.HtmlDecode(evnt.Description); return View(evnt); }
public ActionResult Modify(int id, ActionStatus? status) { ViewBag.Message = status == ActionStatus.Success ? "Updated successfully!" : status == ActionStatus.Failure ? "An error occurred while updating!" : ""; ViewBag.Status = status; List<string> titles = new List<string> { "Mr", "Mrs", "Miss", "Ms", "Dr", "Eng", "Prof", "Rev" }; ViewBag.Titles = new SelectList(titles); ViewBag.Countries = new SelectList(GetAllCountries()); DonorModel donor = donorsBLL.GetDonor(id); return View(donor); }
// キャラクターのアクションステータスに応じた画像を取得 public CharaImage getImage(CharacterStatus characterStatus, ActionStatus actionStatus) { setBreedImage(characterStatus); switch(actionStatus){ case ActionStatus.STOP: current = currentBreed.StopImage; break; case ActionStatus.WALK: current = currentBreed.WalkImage; break; default: current = currentBreed.StopImage; break; } return current; }
private MessageLevel mapper(ActionStatus actionStatus) { switch (actionStatus) { case ActionStatus.Error: case ActionStatus.Conflict: case ActionStatus.AuthenticationRequired: case ActionStatus.Forbidden: case ActionStatus.NotFound: case ActionStatus.RequestTimeOut: return MessageLevel.Error; case ActionStatus.InternalError: return MessageLevel.Critical; case ActionStatus.OK: return MessageLevel.Information; case ActionStatus.Unknown: return MessageLevel.Warning; case ActionStatus.NoContent: return MessageLevel.Information; default: throw ExceptionFactory.New<ArgumentException>("Unable to handle ActionStatus.{0}", actionStatus); } }
public void AddActionStatus(int type, string entityId, string entityCode, string action, string actionDescription) { var user = _authenticationService.GetAuthenticatedUser(); var enterprise = _ownerEnterpriseManager.GetOwner(user); var actions = new ActionStatus() { Type = type, OperatorId = user.Id, OperatorName = user.Name, OperatorDate = System.DateTime.Now, EntityId = entityId, EntityCode = entityCode, Action = action, ActionDescription = actionDescription, OwnerId=enterprise.Id, OwnerName=enterprise.Short==null?enterprise.NameCn:enterprise.Short }; _repActionStatus.Create(actions); }
/// <summary> /// Executes this action this may return immediately or block the current thread, this /// choice is implementation specific. If you need the action the have completed /// before continuing use <see cref="WaitToComplete" /> /// </summary> public void Execute() { lock (_lockObject) { if (_status != ActionStatus.Pending) { return; } _status = ActionStatus.Initiated; } try { InternalExecute(); } catch (Exception e) { MarkFailed(e); } }
public Submittal(object key, SpecificationSection specSection, object projectKey) : base(key, projectKey) { this.specSection = specSection; this.specSectionPrimaryIndex = "01"; this.specSectionSecondaryIndex = "00"; this.to = null; this.from = null; this.dateReceived = null; this.contractNumber = string.Empty; this.trackingItems = new List<TrackingItem>(); this.remarks = string.Empty; this.action = ActionStatus.NoExceptionTaken; this.status = null; this.dateToField = null; this.remainderLocation = SubmittalRemainderLocation.None; this.remainderUnderSubmittalNumber = string.Empty; this.otherRemainderLocation = string.Empty; this.ValidateInitialization(); }
public void ActionChange(ActionStatus status) { if (m_animator) { m_animator.SetInteger("Action", (int)status); switch (status) { case ActionStatus.ActionNormal: { timerID = FrameTimerHeap.AddTimer(100, 0, () => { ActionChange((ActionStatus)ActionDefault); }); } break; case ActionStatus.ActionHand: { timerID = FrameTimerHeap.AddTimer(100, 0, () => { ActionChange((ActionStatus)ActionDefault); }); } break; } } }
/// <summary> /// Creates a state message /// </summary> /// <param name="referenceKey">Field/Property level name (used for IDataErrorInfo bindings)</param> /// <param name="severity">The type of message (info, error, etc)</param> /// <param name="messageText">Text to associate with this state</param> /// <param name="args">Arguments to supply ot this text</param> public ActionReplyMessageItem( string referenceKey, ActionStatus severity, string messageText, params object[] args) { Severity = severity; ReferenceKey = referenceKey; MessageText = TextUtils.StringFormat(messageText, args); }
/// <summary> /// Set the status with a (optional) message and return the object (convenience method) /// </summary> /// <param name="status">Status to set response to</param> /// <param name="message">Text to be added to this response</param> /// <param name="args">List of arugments to supply to message</param> /// <returns>reference to this object</returns> public virtual ActionReply SetStatus(ActionStatus status, string message, params object[] args) { this.Messages.Add(status, message, args); return this; }
/// <summary> /// Set the status and return a reference to this /// </summary> /// <param name="status">Status to set. If this already has a higher reference then higher reference takes prescendence</param> /// <returns>Reference to this object</returns> public virtual ActionReply SetStatus(ActionStatus status) { Status = status; return this; }
// 看看传过来的信息里面,包不包含暗语,做一个翻译,设置相应状态 public static void CheckPassword(string msg) { if (msg.ToUpper().Contains(LeaderName.ToUpper()) && msg.ToUpper().Contains(FBEndPass)) { _Action = ActionStatus.OutFB; return; } if (msg.ToUpper().Contains(LeaderName.ToUpper()) && msg.ToUpper().Contains(FBInPass)) { _Action = ActionStatus.InFB; return; } if (msg.ToUpper().Contains(LeaderName.ToUpper()) && msg.ToUpper().Contains(FBNextStep)) { _Action = ActionStatus.NextStep; return; } if (msg.ToUpper().Contains(LeaderName.ToUpper()) && msg.ToUpper().Contains(FBDirectOut)) { _Action = ActionStatus.DirectOut; return; } }
/// <summary> /// Captures exception, sets severity, and writes reply to log. (Convenience method) /// </summary> /// <param name="exception"></param> /// <param name="severity"></param> /// <returns></returns> public virtual ActionReply SetErrorAndLog(Exception exception, ActionStatus severity) { Messages.Add(exception, severity); Status = severity; LogWrite(); return this; }
private static void gogo() { Dictionary<int, Location> nowpath = new Dictionary<int, Location>(); Ticker isJump = new Ticker(500000); int level = ObjectManager.MyPlayer.Level; int nowlevel = ObjectManager.MyPlayer.Level; int exp = ObjectManager.MyPlayer.ExperiencePercentage; int nowexp = ObjectManager.MyPlayer.ExperiencePercentage; int last_run_exp = ObjectManager.MyPlayer.ExperiencePercentage; DateTime intime = DateTime.Now; DateTime last_run_time = DateTime.Now; while (true) { switch (FBStatus) { case DBStatus.In_EntryChecking: if (isJump.IsReady) { isJump.Reset(); KeyLowHelper.PressKey(MicrosoftVirtualKeys.Space); KeyLowHelper.ReleaseKey(MicrosoftVirtualKeys.Space); Thread.Sleep(4000); } while (!SetLeader()) ; if (CanStart()) { LastLeaderStep = 0; FBStatus = DBStatus.In_LeaderInScopeCheck; Logging.Write("检查大号是不是在范围内"); last_run_exp = ObjectManager.MyPlayer.ExperiencePercentage; exp = ObjectManager.MyPlayer.ExperiencePercentage; level = ObjectManager.MyPlayer.Level; } break; case DBStatus.In_LeaderInScopeCheck: if (isJump.IsReady) { isJump.Reset(); KeyLowHelper.PressKey(MicrosoftVirtualKeys.Space); KeyLowHelper.ReleaseKey(MicrosoftVirtualKeys.Space); Thread.Sleep(4000); } if (IsLeaderInScope()) { nowpath = GetMemPath(); FBStatus = DBStatus.In_Running; int this_turn_exp = ObjectManager.MyPlayer.ExperiencePercentage - last_run_exp; this_turn_exp = this_turn_exp >= 0 ? this_turn_exp : 100 + this_turn_exp; Logging.Write(string.Format("第{0}次跑路。这次共获得经验[{1}],耗时[{2}]。", LastLeaderStep + 1, this_turn_exp, DateTime.Now - last_run_time)); last_run_exp = ObjectManager.MyPlayer.ExperiencePercentage; last_run_time = DateTime.Now; } break; case DBStatus.In_Running: if (isJump.IsReady) { isJump.Reset(); KeyLowHelper.PressKey(MicrosoftVirtualKeys.Space); KeyLowHelper.ReleaseKey(MicrosoftVirtualKeys.Space); Thread.Sleep(4000); } if (MeGoGo(nowpath)) { if (LastLeaderStep == LeaderInFB.Keys.Max()) { FBStatus = DBStatus.In_CheckIsOut; Logging.Write(string.Format("等待大号暗语,准备出本")); } else { FBStatus = DBStatus.In_LeaderInScopeCheck; } LastLeaderStep++; } break; case DBStatus.In_CheckIsOut: if (isJump.IsReady) { isJump.Reset(); KeyLowHelper.PressKey(MicrosoftVirtualKeys.Space); KeyLowHelper.ReleaseKey(MicrosoftVirtualKeys.Space); Thread.Sleep(4000); } if (_Action == ActionStatus.OutFB || _Action == ActionStatus.DirectOut) { Logging.Write(string.Format("收到暗语,出本!!!")); nowlevel = ObjectManager.MyPlayer.Level; nowexp = ObjectManager.MyPlayer.ExperiencePercentage; if (_Action == ActionStatus.OutFB) MeGoGo(GetMemOutPath()); //出副本 Thread.Sleep(200); FBExit.Face(); KeyHelper.PressKey("Up"); while (ObjectManager.InGame) Thread.Sleep(100); KeyHelper.ReleaseKey("Up"); Thread.Sleep(2000); while (!ObjectManager.InGame) Thread.Sleep(100); _Action = ActionStatus.Nothing; Logging.Write(string.Format("出来了,等待暗语,准备进本。上次刷本经验获得了{0}%,耗时{1},升了{2}级", nowexp - exp >= 0 ? nowexp - exp : 100 + nowexp - exp, DateTime.Now - intime, nowlevel - level)); FBStatus = DBStatus.Out_ExitDone; } break; case DBStatus.Out_ExitDone: if (_Action == ActionStatus.InFB) { FBStatus = DBStatus.Out_following; _Action = ActionStatus.Nothing; } break; case DBStatus.Out_following: if (isJump.IsReady) { isJump.Reset(); KeyLowHelper.PressKey(MicrosoftVirtualKeys.Space); KeyLowHelper.ReleaseKey(MicrosoftVirtualKeys.Space); Thread.Sleep(4000); } Logging.Write(string.Format("进本!!!")); FBEntry.Face(); KeyHelper.PressKey("Up"); while (ObjectManager.InGame) Thread.Sleep(100); KeyHelper.ReleaseKey("Up"); Thread.Sleep(2000); while (!ObjectManager.InGame) Thread.Sleep(100); Logging.Write(string.Format("进副本了,现在是{0}级,经验{1}%", ObjectManager.MyPlayer.Level, ObjectManager.MyPlayer.ExperiencePercentage)); level = ObjectManager.MyPlayer.Level; exp = ObjectManager.MyPlayer.ExperiencePercentage; last_run_exp = exp; intime = DateTime.Now; last_run_time = intime; FBStatus = DBStatus.In_EntryChecking; break; } Thread.Sleep(100); } }
private static bool IsLeaderInScope() { //if (!LeaderInFB.ContainsKey(LastLeaderStep)) return false; if (_Action == ActionStatus.NextStep) { _Action = ActionStatus.Nothing; return true; } //double dd = leader.Location.DistanceFromXY(LeaderInFB[LastLeaderStep]); //if (dd < Scope) //{ // return true; //} return false; }
public static Color getColorForActionStatus(ActionStatus stat) { if (stat == ActionStatus.None) { return Color.White; } else if (stat == ActionStatus.Queued) { return Color.Aqua; } else if (stat == ActionStatus.Pending) { return Color.Yellow; } else if (stat == ActionStatus.Success) { return Color.FromArgb(0x4b, 0xe5, 0x9b); } else if (stat == ActionStatus.Failure) { return Color.FromArgb(0xff, 0x6e, 0x53); } else { return Color.Orange; } }
public static bool Init(string _leadername, Location _fbin, Location _fbout, Dictionary<int, Location> _lloc, Dictionary<int, Location> _path, Dictionary<int, int> _map) { LastLeaderStep = 0; FBStatus = DBStatus.In_EntryChecking; _Action = ActionStatus.Nothing; LeaderName = _leadername.ToUpper(); if (!SetLeader()) return false; FBEntry = _fbin; FBExit = _fbout; LeaderInFB = _lloc; memInFB = _path; MapOverLeaderAndMem = _map; return true; }
/// <summary> /// Explicitly add message to reply that is considered by caller to be of a specific importance /// </summary> /// <param name="status">Callers preception on how important this message is</param> /// <param name="message">Textual portion of message</param> /// <param name="args">Arguments to supply to <paramref name="message"/></param> /// <returns>Reference to this object</returns> public ActionReply SetStatusAndLog(ActionStatus status, string message, params object[] args) { Status = status; Messages.Add(status, message, args); return this; }
public ActionResult(string msg, ActionStatus stat) { this.Message = msg; this.Status = stat; }
/// <summary> /// Convenience method to add formatted parameter values to reply. Default severity: information /// </summary> /// <param name="severity">Describes how important this parameter note is to be considered</param> /// <param name="paramName">Name of property or parameter</param> /// <param name="paramValue">Current value of parameter</param> public void AddParam(ActionStatus severity, string paramName, object paramValue) { ActionReplyMessageItem item = new ActionReplyMessageItem(paramName, severity, "Param: {0}: {1}", paramName, paramValue); item.Severity = severity; Messages.Add(item); }
// キャラクターの状態のセット public void setState(ActionStatus setState) { actionState = setState; actionCounter = ACT_COUNTER_MAX; }
/// <summary> /// Handles the ActionCompleted event of the GestureButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="ActionEventArgs" /> instance containing the event data.</param> void GestureButton_ActionCompleted(object sender, ActionEventArgs e) { this.Status = ActionStatus.Completed; this.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); }
/// <summary> /// Handles the ActionExit event of the GestureButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="ActionEventArgs" /> instance containing the event data.</param> void GestureButton_ActionExit(object sender, ActionEventArgs e) { if (this.Status == ActionStatus.Enter) { this.Status = ActionStatus.Exit; buttonEffects.Completed -= new EventHandler(effectsCompleted); buttonEffects = new DoubleAnimation(20, 12, new Duration(new TimeSpan(0, 0, 2))); this.BeginAnimation(TextBlock.FontSizeProperty, buttonEffects); } }