Inheritance: MonoBehaviour
Beispiel #1
0
 /// <summary>Initialize a new worker with the specified action.
 /// </summary>
 /// <param name="actionName">The action name.</param>
 /// <param name="action">The action to run by the worker.</param>
 public Worker(string actionName, Action action)
 {
     _actionName = actionName;
     _action = action;
     _status = Status.Initial;
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
 }
Beispiel #2
0
 // The following return usernames
 /// <summary>
 /// Create a game between 2 players
 /// </summary>
 /// <param name="Player1">
 /// </param>
 /// <param name="Player2"></param>
 public Game(String Player1, String Player2)
 {
     GameStatus = Status.PENDING;
     this.Player1 = Player1;
     this.Player2 = Player2;
     this.Board = (int[][]) DefaultBoard.Clone ();
 }
Beispiel #3
0
 //verifica se dois status são iguais(compara o valor dos atributos)
 public bool ehIgual(Status outroStatus)
 {
     bool ehIgual = true;
     if(this.forca != outroStatus.forca) {
         ehIgual = false;
     }
     else if (this.inteligencia != outroStatus.inteligencia) {
         ehIgual = false;
     }
     else if (this.vitalidade != outroStatus.vitalidade) {
         ehIgual = false;
     }
     else if(this.defesa != outroStatus.defesa) {
         ehIgual = false;
     }
     else if(this.magia != outroStatus.magia) {
         ehIgual = false;
     }
     else if(this.ataque != outroStatus.ataque) {
         ehIgual = false;
     }
     else if(this.hp != outroStatus.hp) {
         ehIgual = false;
     }
     else if(this.mp != outroStatus.mp) {
         ehIgual = false;
     }
     return ehIgual;
 }
Beispiel #4
0
 private void DoWalkOrClimb(string tag)
 {
     switch (tag)
     {
         case "Up":
             TimeToWait = Consts.WalkTime;
             TimeSwitchs.GetInput = true;
             PlayerStatus = Status.Climb;
             PlayerAnimator.SetTrigger("Climb");
             PlayerRigibody.velocity = new Vector2(0, Consts.MoveSpeed);
             break;
         case "Down":
             TimeToWait = Consts.WalkTime;
             TimeSwitchs.GetInput = true;
             PlayerStatus = Status.Climb;
             PlayerAnimator.SetTrigger("Climb");
             PlayerRigibody.velocity = new Vector2(0, -Consts.MoveSpeed);
             break;
         case "Left":
             TimeToWait = Consts.WalkTime;
             TimeSwitchs.GetInput = true;
             PlayerStatus = Status.Walk;
             PlayerAnimator.SetTrigger("Walk");
             PlayerRigibody.velocity = new Vector2(-Consts.MoveSpeed, 0f);
             break;
         case "Right":
             TimeToWait = Consts.WalkTime;
             TimeSwitchs.GetInput = true;
             PlayerStatus = Status.Walk;
             PlayerAnimator.SetTrigger("Walk");
             GetComponent<Rigidbody2D>().velocity = new Vector2(Consts.MoveSpeed, 0f);
             break;
     }
 }
Beispiel #5
0
        public static string FormatStatusHtml(Status inputStatus)
        {
            StringBuilder output = new StringBuilder();
            string tlitemClass = "tlitem";

            // If your user name is found in the text of any status, change the style.
            if (inputStatus.Text.ToLower().Contains(Properties.Settings.Default.UserName.ToLower()))
            {
                tlitemClass = "tlitemAlert";
            }
            else if (inputStatus.User.ScreenName == TwitterManager.Instance().CurrentUser.ScreenName)
            {
                tlitemClass = "tlitemMine";
            }

            // Build the output
            output.Append("<tweet><div class=\"" + tlitemClass + "\">");
            output.Append("    <div class=\"tlimage\">");
            output.Append("        <img onclick=\"window.external.SetReply('" + inputStatus.User.ScreenName + "');\" src=\"" + inputStatus.User.ProfileImageUrl + "\" alt=\"" + inputStatus.User.Name + " (" + inputStatus.User.ScreenName + ")\" />");
            output.Append("    </div>");
            output.Append("    <div class=\"tldetails\">");
            output.Append("        <h2>" + inputStatus.User.ScreenName + "</h2>");
            output.Append("        <span class=\"tlcommands\">");
            output.Append("             <span class=\"tlcreated\">" + inputStatus.CreatedAt.ToShortTimeString() + "</span><br />");
            output.Append("             <span class=\"directReply\" onclick=\"window.external.SetReplyCommand('" + inputStatus.User.ScreenName + "','d');\">Direct Reply</span><br />");
            output.Append("             <span class=\"publicReply\" onclick=\"window.external.SetReply('" + inputStatus.User.ScreenName + "');\">Public Reply</span>");
            output.Append("        </span>");
            output.Append("        <div class=\"tltext\">" + Format(inputStatus.Text) + "</div>");
            output.Append("    </div>");
            output.Append("</div></tweet>");
            return output.ToString();
        }
        /// <summary>
        /// Creates the SM of the primite action: Take-Object
        /// </summary>
        /// <param name="brain">HAL9000Brain instance</param>
        /// <param name="cmdMan">HAL9000CmdMan instance</param>
        /// <param name="objectToTake">Name of the object to take. Default: empty string.</param>
        public NavigateTo(HAL9000Brain brain, HAL9000CmdMan cmdMan, GPSR_WORLD SMConfiguration, string locationToReach = "")
        {
            this.brain = brain;
            this.cmdMan = cmdMan;

            finalStatus = Status.Ready;

            this.SMConfiguration = SMConfiguration;
            this.locationToReach = locationToReach;

            navigSucceded = "I reach the location.";
            navigFailed = "I can't reach the location.";

            SM = new FunctionBasedStateMachine();
            SM.AddState(new FunctionState((int)States.InitialState, InitialState));

            SM.AddState(new FunctionState((int)States.RiseArms, RiseArms));
            SM.AddState(new FunctionState((int)States.Navigate, Navigate));
            SM.AddState(new FunctionState((int)States.Navigate_Succeeded, Navigate_Succeeded));
            SM.AddState(new FunctionState((int)States.Navigate_Failed, Navigate_Failed));

            SM.AddState(new FunctionState((int)States.FinalState, FinalState, true));

            SM.SetFinalState((int)States.FinalState);
        }
Beispiel #7
0
		/// <summary>
		/// 指定したツイートを起点とした会話ツリーを取得します。
		/// </summary>
		/// <param name="root"></param>
		/// <returns></returns>
		public StatusCollection Get(Status root)
		{
			return this.DoReadLockAction(() =>
			{
				var list = new List<Status> { root };
				var current = root;

				// 起点より古いツイートの抽出 (in_reply_to を辿っていく)
				while (current.DisplayStatus.InReplyToStatusId.HasValue)
				{
					Status next;
					if (this.statuses.TryGetValue(current.DisplayStatus.InReplyToStatusId.Value, out next))
					{
						list.Add(next);
						current = next;
					}
					else break;
				}

				// 起点より新しいツイートの抽出 (ReplyFrom を使って逆方向へ辿る (再帰でツリーすべてをさらう感じ))
				Action<Status> recursion = null;
				recursion = status =>
				{
					status.DisplayStatus.ReplyFrom.ForEach(s => recursion(s));
					list.Add(status);
				};
				recursion(root);

				return new StatusCollection(list.OrderByDescending(s => s.Id));
			});
		}
    public SCAnimationInfo(Action callback, float time)
    {
        mCallback = callback;
        mTime = time;

        mStatus = Status.NOT_STARTED;
    }
 async private void OnUploadData()
 {
     IsUploading = true;
     await UploadData(Name);
     IsUploading = false;
     Status = Status.Uploaded;
 }
Beispiel #10
0
 public Registro(Conta Conta, DateTime DataAgendamento, double Valor, Status Status)
 {
     this.Conta = Conta;
     this.DataAgendamento = DataAgendamento;
     this.Valor = Valor;
     this.Status = Status;
 }
Beispiel #11
0
    //상테와 파라메터를 통해 아처의 상태를 컨트롤 합니다.
    public void SetStatus(Status status)
    {
        //animator 에서 만든 상태 간 전이를 상황에 맞게 호출 한다.
        switch (status) {
        case Status.Idle:
            mAnimator.SetTrigger("Idle");
            Debug.Log("idle---");
            break;

        case Status.Attack:
            mAnimator.SetTrigger("Basic_Attack");
            Debug.Log("Attack---");
            break;

        case Status.Dead:
            mAnimator.SetTrigger("Dead");
            Debug.Log("Die---");
            break;

        case Status.Damaged:
            mAnimator.SetTrigger("Damaged");
            Debug.Log("Damage---");
            break;

        case Status.UseSkill:
            mAnimator.SetTrigger("Skill01");
            Debug.Log("Skill---");
            break;

        }
    }
Beispiel #12
0
		public override void OnUpdate(Status ks)
		{
			var lst = new List<Entity>(Parent.FindEntitiesByType<EntityPlayer>());
			foreach (var entity in lst)
			{
				var ep = (EntityPlayer) entity;
				if (ep.IsDying)
					continue;
				if (
					new RectangleF(ep.Location.X, ep.Location.Y + 1, ep.Size.Width, ep.Size.Height - 1).CheckCollision(
						new RectangleF(Location.X + 2, Location.Y + 4, 12, 12)) && ep.Velocity.Y < 0)
					OpenItem(ep);
			}
			foreach (var entity in new List<Entity>(Parent.FindEntitiesByType<EntityTurcosShell>()))
			{
				var m = (EntityTurcosShell) entity;
				if (m.IsRunning &&
					new RectangleF(Location.X - 4, Location.Y + 8, 24, 8).CheckCollision(new RectangleF(m.Location, m.Size)))
				{
					try
					{
						OpenItem((EntityPlayer) Parent.First(s => s is EntityPlayer));
					}
					catch
					{
						// 握りつぶす
					}
					break;
				}
			}
		}
Beispiel #13
0
 public Status GetStatus()
 {
     HttpClient client = new HttpClient();
     if (Key == null)
     {
         throw new Exception("Captcha.GetStatus: Key is null");
     }
     if (CaptchaID == null)
     {
         throw new Exception("Captcha.GetStatus: CaptchaID is null");
     }
     string resp=client.DownloadString("http://antigate.com/res.php?key="+
                                       Key+"&action=get&id="+CaptchaID.ToString());
     if (resp.Contains("CAPCHA_NOT_READY"))
     {
         CaptchaStatus = Status.NotReady;
         return Status.NotReady;
     }
     if(resp.Substring(0,2)=="OK")
     {
         CaptchaText = resp.Substring(3);
         CaptchaStatus=Status.Success;
         return Status.Success;
     }
     CaptchaStatus=Status.Error;
     return Status.Error;
 }
    void Start()
    {
        var controller = HelloApp.App.Get<HomeController>();
        var model = controller.SceneInfo().Model.As<SceneInfoViewModel>();
        model.BackButton.Manifest();

        var r = new nResolver();
        var db = r.Resolve<nUnityDb>();
        db.Count<Status>(delegate (int count) {
          if (count == 0) {
        nLog.Debug("Found no instances; creating one");
        var record = new Status();
        record.Value = "Hello World";
        record.IdValue = 99;
        db.Insert(record, delegate {
          nLog.Debug("Inserted");
        });
          }
          else {
        db.All<Status>(0, 1, delegate (IEnumerable<Status> items) {
          var item = items.First();
          nLog.Debug ("Loaded value was: " + item.Value);
          nLog.Debug ("Loaded id was: " + item.IdValue);
        });
          }
        });
    }
		private void UpdateBehavior(Status ks)
		{
			if (Location.X < 0)
				Kill();

			if (Location.X > ks.Map.Width * 16 - 16)
				Kill();

			if (Location.Y < 0)
			{
				Velocity.Y = 0;
				Location.Y = 0;
			}

			if (Location.Y > ks.Map.Height * 16)
				Kill(true, false);

			foreach (EntityLiving e in new List<Entity>(Parent.FindEntitiesByType<EntityLiving>()))
				if (!e.IsDying && (e.MyGroup == EntityGroup.Enemy) &&
					new RectangleF(Location, Size).CheckCollision(new RectangleF(e.Location, e.Size)))
				{
					e.Kill();
					Kill();
				}
			if (Life < 1)
				Kill();
			if (CollisionBottom() == ObjectHitFlag.Hit)
			{
				Velocity.Y = -2.5f;
				Life--;
			}
			if ((CollisionLeft() == ObjectHitFlag.Hit) || (CollisionRight() == ObjectHitFlag.Hit))
				Kill();
		}
 public Version(Status status, string firmware, string revision, string build)
 {
     Status = status;
     Firmware = firmware;
     Revision = revision;
     Build = build;
 }
 public new void SetUp()
 {
     _status = SingletonProvider<TestSetup>.Instance.GetApp().Status;
      string logFile = _settings.Logging.CurrentDefaultLog;
      if (File.Exists(logFile))
     File.Delete(logFile);
 }
Beispiel #18
0
 public GameAction(Status gameStatus, Team actionTeam, Point actionPoint)
 {
     ActionTeam = actionTeam;
     ActionPoint = actionPoint;
     GameStatus = gameStatus;
     ThrowRoom = new Rectangle(0, 0, 0, 0);
 }
 public JsonResult reviews(int id, string commentStr) {
     BaWuClub.Web.Dal.User user = GetUser();
     string url="/account/login";
     string context = string.Empty;
     if (user != null) {
         VideoReview reviews = new VideoReview();
         reviews.UserId=user.Id;
         reviews.VideoId=id;
         reviews.Review=HtmlCommon.ClearJavascript(commentStr);
         reviews.VarDate=DateTime.Now;
         reviews.IP = Request.UserHostAddress;
         using (club = new ClubEntities()) {
             club.VideoReviews.Add(reviews);
             if (club.SaveChanges() >= 0){
                 status = Status.success;
                 StringBuilder str = new StringBuilder();
                 str.Append("<div class=\"comment-item\">");
                 str.Append("<div class=\"comment-item-info\">");
                 str.Append("<a href=\"/member/u-" + user.Id + "/show/\" class=\"comment-item-info-name\">" + user.NickName + "</a>");
                 str.Append("<a href=\"/member/u-" + user.Id + "/show/\" class=\"comment-item-info-avatar\"><img src=\"" + (string.IsNullOrEmpty(user.Cover) ? "/content/images/no-img.jpg" : "~/uploads/avatar/small/" + user.Cover) + "\"/>");
                 str.Append("</a>");
                 str.Append("</div>");
                 str.Append("<div class=\"comment-item-content\">" + HtmlCommon.ClearJavascript(reviews.Review) + "</div>");
                 str.Append("<div class=\"comment-item-meta\"><span>评论与" + HtmlCommon.GetAnswerTimeSpan((DateTime)reviews.VarDate) + "</span></div>");
                 str.Append("</div>");
                 context = str.ToString();
             }
             else{
                 status = Status.warning; context = "系统异常,操作失败,请稍后重试!";
             }
         }                
     }
     return Json(new { status = status.ToString(), context = context, url = url });
 }
Beispiel #20
0
 public static List<Actions> initialization(List<string> strLstActions, Status thisStat)
 {
     List<Character> chaLstCharacters = thisStat.chaLstCharacter;
     List<Spell> splLstAll = thisStat.splLstSpell;
     List<Actions> actLstResult = new List<Actions>();
     Regex rgSource = new Regex("{.*}");
     Regex rgSpell = new Regex("\\[\\[.*\\]\\]");
     Regex rgDestination = new Regex("->.*<-");
     string strTmp = "";
     for (int i = 0; i < strLstActions.Count; i++)
     {
         Actions actionItem = new Actions();
         strTmp = rgSource.Match(strLstActions[i]).ToString();
         strTmp = strTmp.Replace("{", "");
         actionItem.strCharacterName = strTmp.Replace("}", "");
         strTmp = rgSpell.Match(strLstActions[i]).ToString();
         strTmp = strTmp.Replace("[[", "");
         actionItem.strSpellName = strTmp.Replace("]]", "");
         strTmp = rgDestination.Match(strLstActions[i]).ToString();
         strTmp = strTmp.Replace("->", "");
         actionItem.intCharacter = Character.findIndexForCharacter(actionItem.strCharacterName, chaLstCharacters);
         strTmp = strTmp.Replace("<-", "");
         actionItem.intDestination = Character.findIndexForCharacter(strTmp, chaLstCharacters);
         actionItem.intResult = 0;
         actionItem.intTargetAvailable = Spell.isSpellTargetFixed(actionItem.strSpellName, splLstAll);
         actLstResult.Add(actionItem);
     }
     return actLstResult;
 }
 public static void LateBoundTypeFailure(IStatusAppender s, string originalString, Exception ex)
 {
     Component component = typeof(RuntimeWarning).Assembly.AsComponent();
     Status status = new Status(
         component, SR.LateBoundTypeFailure(originalString), ex, FileLocation.Empty);
     s.Append(status);
 }
 public Specification(string name, Result result)
 {
   _status = result.Status;
   _exception = result.Exception;
   _supplements = result.Supplements;
   _name = name;
 }
Beispiel #23
0
        public Udp(Status status, string hostName, string ipAddress, int port)
        {
            Status = status;
            HostName = hostName;

            Endpoint = new IPEndPoint(IPAddress.Parse(ipAddress), port);
        }
 public BlockObject(Transform block,float width,float height)
 {
     this.block =block;
     this.status = Status.Active;
     this.width = width;
     this.height = height;
 }
        /// <summary>
        /// Internal Unity method.
        /// This method is called whenever the object is enabled/re-enabled.
        /// Initializes all local variables which are frequently used.
        /// Always check so that the variables are valid at start, so I don't have to later.
        /// "GameObject.FindObjectOfType" method is kind of expensive and should be used as sparingly as possible.
        /// </summary>
        void OnEnable()
        {
            if(m_transformComponent == null)
                m_transformComponent = this.GetComponent<Transform>();

            m_sphereMovementStatus = Status.Idle;
        }
Beispiel #26
0
 /// <summary>
 /// For serialisation.
 /// </summary>
 /// <param name="gameStatus"></param>
 /// <param name="teamId"></param>
 /// <param name="actionPoint"></param>
 public CachedGameAction(Status gameStatus, int teamId, Point actionPoint)
 {
     TeamId = teamId;
     ActionPoint = actionPoint;
     GameStatus = gameStatus;
     ThrowRoom = new Rectangle(0, 0, 0, 0);
 }
Beispiel #27
0
 	public override void Reset () {
         convertReadyTo = Status.Ready;
         convertSuccessTo = Status.Success;
         convertFailureTo = Status.Failure;
         convertErrorTo = Status.Error;
         convertRunningTo = Status.Running;
     }
        private void drawMiniContractsGoals(Mission mission, Status s)
        {
            int index = 1;
            foreach (MissionGoal c in mission.goals)
            {
                if (hiddenGoals.Contains(c))
                {
                    index++;
                    continue;
                }
                List<Value> values = c.getValues(activeVessel, s.events);

                foreach (Value v in values)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Label(v.name, styleValueName);

                    GUILayout.Label(v.shouldBe + " : " + v.currentlyIs, (v.done ? styleValueGreen : styleValueRed));

                    GUILayout.EndHorizontal();
                }
                if (activeVessel != null)
                {
                    if (s.finishableGoals.ContainsKey(c.id) && s.finishableGoals[c.id])
                    {
                        hiddenGoals.Add(c);
                    }

                }

            }
        }
    public void ReAutoTarget()
    {
        // 타겟을 재 탐색합니다.

        mMonsterCount -= 1;
        TargetMonster = null;
        if(mMonsterCount == 0)
        {
            // 몬스터를 모두 클리어 하였습니다.
            Debug.Log ("Clear");

            mLoopCount -= 1;

            // 모든 공격과 스텝을 중지시킵니다.
            StopCoroutine("ArcherAttack");
            StopCoroutine("MonsterAttack");
            StopCoroutine("AutoStep");

            if(mLoopCount == 0)
            {
                // 모든 스테이지가 클리어 되었습니다.
                Debug.Log("Stage All Clear");
                GameOver();
                return;
            }

            // 던전 스텝을 초기화 시키고 다시 순환 시킵니다.
            mStatus = Status.Idle;
            StartCoroutine("AutoStep");
            return;
        }

        // 타겟 재 탐색
        GetAutoTarget();
    }
 public static string ParseStatus(Status status)
 {
     switch (status)
     {
         case Status.Queued:
             return "Queued";
         case Status.Sending:
             return "Sending";
         case Status.Sent:
             return "Sent";
         case Status.Receiving:
             return "Receiving";
         case Status.Received:
             return "Received";
         case Status.Delivered:
             return "Delivered";
         case Status.Undelivered:
             return "Undelivered"; ;
         case Status.Failed:
             return "Failed";
         case Status.Processing:
             return "Received"; //Processing is an internal status
         case Status.Processed:
             return "Received"; //Processed is an internal status
         case Status.Error:
             return "Error";
         default:
             return string.Empty;
     }
 }
 protected void ToString(List <string> toStringOutput)
 {
     toStringOutput.Add($"Status = {(Status == null ? "null" : Status.ToString())}");
     toStringOutput.Add($"Card = {(Card == null ? "null" : Card.ToString())}");
     toStringOutput.Add($"EntryMethod = {(EntryMethod == null ? "null" : EntryMethod.ToString())}");
 }
Beispiel #32
0
 Monster(Status _status, System.Drawing.Point pos) : base(_status, pos)
 {
     status.type = Type.Enemy;
 }
Beispiel #33
0
        public ActionResult Create(MemberInfo iMemberInfo)
        {
            if (string.IsNullOrWhiteSpace(iMemberInfo.FirstName))
            {
                ModelState.AddModelError("FirstName", "Please enter first name");
            }

            if (string.IsNullOrWhiteSpace(iMemberInfo.LastName))
            {
                ModelState.AddModelError("LastName", "Please enter last name");
            }

            //if (string.IsNullOrWhiteSpace(iMemberInfo.Password))
            //    ModelState.AddModelError("Password", "Please enter Password");

            if (string.IsNullOrWhiteSpace(iMemberInfo.PhoneNumber))
            {
                ModelState.AddModelError("PhoneNumber", "Please enter Phone Number");
            }
            else
            {
                //iMemberInfo.PhoneNumber = new string(iMemberInfo.PhoneNumber.Where(char.IsDigit).ToArray());

                //if (!Regex.IsMatch(iMemberInfo.PhoneNumber, @"^[0-9]*$"))
                //    ModelState.AddModelError("PhoneNumber", "Enter a valid phone number");
                string PhoneRegex = @"^([0-9]{10})$";
                Regex  phonere    = new Regex(PhoneRegex);
                if (!phonere.IsMatch(iMemberInfo.PhoneNumber))
                {
                    ModelState.AddModelError("PhoneNumber", "Enter a valid phone number");
                }
                else if (iMemberInfo.PhoneNumber.Length != 10)
                {
                    ModelState.AddModelError("PhoneNumber", "Phone number should be 10 digits");
                }
            }
            if (!string.IsNullOrEmpty(iMemberInfo.EmailAddress))
            {
                string emailRegex = @"^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$";
                Regex  re         = new Regex(emailRegex);
                if (!re.IsMatch(iMemberInfo.EmailAddress))
                {
                    ModelState.AddModelError("EmailAddress", "Please Enter Correct Email Address");
                }
            }
            else if (string.IsNullOrWhiteSpace(iMemberInfo.EmailAddress))
            {
                ModelState.AddModelError("EmailAddress", "Please enter EmailAddress");
            }

            if (string.IsNullOrWhiteSpace(iMemberInfo.Address))
            {
                ModelState.AddModelError("Address", "Please enter address");
            }

            if (!(iMemberInfo.isActive))
            {
                ModelState.AddModelError("isActive", "Please check Active");
            }
            if (!ModelState.IsValid)
            {
                return(View());
            }

            try
            {
                using (var client = new HttpClient())
                {
                    iMemberInfo.iMode = 101;
                    //iMemberInfo.Id = iMemberInfo.Id;
                    // iMemberInfo.iMode = 122;
                    client.BaseAddress = new Uri(Utility.BaseURL);
                    var    response = client.PostAsJsonAsync("SetMemberDetails", iMemberInfo).Result;
                    Status status   = response.Content.ReadAsAsync <Status>().Result;
                    if (status.Errors == null)
                    {
                        TempData["JavaScriptFunction"] = string.Format("fnSuccess('0');");
                        //return RedirectToAction("Index");
                        return(View());
                        //  return RedirectToAction("Create", new { displaymessage = "Success" });
                    }
                    else
                    {
                        TempData["JavaScriptFunction"] = string.Format("fnSuccess('1');");
                        return(View());
                    }
                }
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Create", new { message = "Failed" }));
            }
        }
Beispiel #34
0
        public ActionResult Index(int?page)
        {
            //if (Convert.ToString(Session["Email"]) =="")
            //{
            //    return RedirectToAction("Index", "Login");
            //}

            //int pageSize = 5;
            //int pageIndex = 1;
            //pageIndex = page.HasValue ? Convert.ToInt32(page) : 1;
            //IPagedList<MemberInfo> MI = null;

            using (var client = new HttpClient())
            {
                iMemberInfo.iMode  = 102;
                client.BaseAddress = new Uri(Utility.BaseURL);
                var    response = client.PostAsJsonAsync("GetMemberDetails", iMemberInfo).Result;
                Status status   = response.Content.ReadAsAsync <Status>().Result;
                if (status.Errors == null)
                {
                    DataTable dt = (DataTable)JsonConvert.DeserializeObject(status.Data.ToString(), (typeof(DataTable)));
                    if (dt.Rows.Count > 0)
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        //foreach(DataRow dr in dt.Rows)
                        {
                            iMemberInfo = new MemberInfo
                            {
                                ID           = Convert.ToInt32(dt.Rows[i]["Id"]),
                                EmpID        = Convert.ToString(dt.Rows[i]["EmpID"]),
                                FirstName    = Convert.ToString(dt.Rows[i]["FirstName"]),
                                LastName     = Convert.ToString(dt.Rows[i]["LastName"]),
                                PhoneNumber  = Convert.ToString(dt.Rows[i]["PhoneNumber"]),
                                EmailAddress = Convert.ToString(dt.Rows[i]["EmailAddress"]),
                                Address      = Convert.ToString(dt.Rows[i]["Address"]),
                                isActive     = Convert.ToBoolean(dt.Rows[i]["isActive"]),
                            };

                            //iMemberInfo = new MemberInfo
                            //{
                            //    ID = Convert.ToInt32(dr["ID"]),
                            //    EmpID = Convert.ToString(dr["EmpID"]),
                            //    FirstName = Convert.ToString(dr["FirstName"]),
                            //    LastName = Convert.ToString(dr["LastName"]),
                            //    PhoneNumber = Convert.ToString(dr["PhoneNumber"]),
                            //    EmailAddress = Convert.ToString(dr["EmailAddress"]),
                            //    Address = Convert.ToString(dr["Address"]),
                            //    isActive = Convert.ToBoolean(dr["isActive"]),
                            //};

                            //iMemberInfo.std = listMember;
                            //MI = listMember.ToPagedList(pageIndex, pageSize);
                            listMember.Add(iMemberInfo);
                        }
                    }
                }
            }
            ViewData["Norecords"] = "No records found";
            //return View(MI);
            return(View(listMember));
        }
Beispiel #35
0
        // 「待機」コマンド
        // 他のコマンドの終了処理にも使われる
        private void WaitCommand(bool WithoutAction = false)
        {
            LogDebug();

            // コマンド終了時はターゲットを解除
            SelectedTarget = null;

            // ユニットにパイロットが乗っていない?
            if (SelectedUnit.CountPilot() == 0)
            {
                CommandState = "ユニット選択";
                GUI.RedrawScreen();
                Status.ClearUnitStatus();
                return;
            }

            if (!WithoutAction)
            {
                // 残り行動数を減少させる
                SelectedUnit.UseAction();

                // 持続期間が「移動」のスペシャルパワー効果を削除
                if (Strings.InStr(CommandState, "移動後") > 0)
                {
                    SelectedUnit.RemoveSpecialPowerInEffect("移動");
                }
            }

            CommandState = "ユニット選択";

            // アップデート
            SelectedUnit.Update();
            SRC.PList.UpdateSupportMod(SelectedUnit);

            // ユニットが既に出撃していない?
            if (SelectedUnit.Status != "出撃")
            {
                GUI.RedrawScreen();
                Status.ClearUnitStatus();
                return;
            }

            GUI.LockGUI();
            GUI.RedrawScreen();
            var p = SelectedUnit.Pilots.First();

            // 接触イベント
            foreach (var unit in Map.AdjacentUnit(SelectedUnit))
            {
                SelectedTarget = unit;
                Event.HandleEvent("接触", SelectedUnit.MainPilot().ID, SelectedTarget.MainPilot().ID);
                SelectedTarget = null;
                if (SRC.IsScenarioFinished)
                {
                    SRC.IsScenarioFinished = false;
                    return;
                }

                if (SelectedUnit.Status != "出撃")
                {
                    GUI.RedrawScreen();
                    Status.ClearUnitStatus();
                    GUI.UnlockGUI();
                    return;
                }
            }

            // 進入イベント
            Event.HandleEvent("進入", SelectedUnit.MainPilot().ID, "" + SelectedUnit.x, "" + SelectedUnit.y);
            if (SRC.IsScenarioFinished)
            {
                SRC.IsScenarioFinished = false;
                return;
            }

            if (SelectedUnit.CountPilot() == 0)
            {
                GUI.RedrawScreen();
                Status.ClearUnitStatus();
                GUI.UnlockGUI();
                return;
            }

            // 行動終了イベント
            Event.HandleEvent("行動終了", SelectedUnit.MainPilot().ID);
            if (SRC.IsScenarioFinished)
            {
                SRC.IsScenarioFinished = false;
                return;
            }

            if (SelectedUnit.CountPilot() == 0)
            {
                GUI.RedrawScreen();
                Status.ClearUnitStatus();
                GUI.UnlockGUI();
                return;
            }

            if (p.Unit is object)
            {
                SelectedUnit = p.Unit;
            }

            if (SelectedUnit.Action > 0 && SelectedUnit.CountPilot() > 0)
            {
                // カーソル自動移動
                if (SRC.AutoMoveCursor)
                {
                    GUI.MoveCursorPos("ユニット選択", SelectedUnit);
                }
            }

            // ハイパーモード・ノーマルモードの自動発動をチェック
            SelectedUnit.CurrentForm().CheckAutoHyperMode();
            SelectedUnit.CurrentForm().CheckAutoNormalMode();
            if (GUI.IsPictureVisible || GUI.IsCursorVisible)
            {
                GUI.RedrawScreen();
            }

            GUI.UnlockGUI();

            //// ステータスウィンドウの表示内容を更新
            //if (SelectedUnit.Status == "出撃" && GUI.MainWidth == 15)
            //{
            //    Status.DisplayUnitStatus(SelectedUnit);
            //}
            //else
            //{
            //    Status.ClearUnitStatus();
            //}
        }
Beispiel #36
0
 public override void ReadCompletionCallback(ref CustomType key, ref CustomType input, ref CustomType output, byte ctx, Status status)
 {
     if (ctx == 0)
     {
         if (status != Status.OK || key.payload + 10000 != output.payload)
         {
             throw new Exception("Incorrect read result");
         }
     }
     else if (ctx == 1)
     {
         if (status != Status.OK || key.payload + 10000 + 25 + 25 != output.payload)
         {
             throw new Exception("Incorrect read result");
         }
     }
     else
     {
         throw new Exception("Unexpected user context");
     }
 }
Beispiel #37
0
 public void RunSearch()
 {
     State = Status.Checking;
     USBKiller.Run();
 }
 public async Task <IActionResult> Status([FromBody] Status request)
 {
     return(await this.Process(() => this._statusPublisher.Publish(request)));
 }
Beispiel #39
0
        private void UserDefineUnitCommand(UiCommand command)
        {
            var unit             = SelectedUnit;
            var prev_used_action = unit.UsedAction;

            GUI.LockGUI();

            // ユニットコマンドの使用イベント
            Event.HandleEvent("使用", unit.MainPilot().ID, command.Label);
            if (SRC.IsScenarioFinished)
            {
                SRC.IsScenarioFinished = false;
                GUI.UnlockGUI();
                return;
            }

            if (SRC.IsCanceled)
            {
                SRC.IsCanceled = false;
                WaitCommand();
                return;
            }

            // ユニットコマンドを実行
            Event.HandleEvent("" + command.LabelData.EventDataId);
            if (SRC.IsCanceled)
            {
                SRC.IsCanceled = false;
                CancelCommand();
                GUI.UnlockGUI();
                return;
            }

            // ユニットコマンドの使用後イベント
            if (unit.CurrentForm().CountPilot() > 0)
            {
                Event.HandleEvent("使用後", unit.CurrentForm().MainPilot().ID, command.Label);
                if (SRC.IsScenarioFinished)
                {
                    SRC.IsScenarioFinished = false;
                    GUI.UnlockGUI();
                    return;
                }
            }

            // ステータスウィンドウを更新
            if (unit.CurrentForm().CountPilot() > 0)
            {
                Status.DisplayUnitStatus(unit.CurrentForm());
            }

            // 行動終了
            if (unit.CurrentForm().UsedAction <= prev_used_action)
            {
                if (CommandState == "移動後コマンド選択")
                {
                    WaitCommand();
                }
                else
                {
                    CommandState = "ユニット選択";
                    GUI.UnlockGUI();
                }
            }
            else if (SRC.IsCanceled)
            {
                SRC.IsCanceled = false;
            }
            else
            {
                WaitCommand(true);
            }
        }
Beispiel #40
0
 public LogEntry(DateTime occurred, Status status, string text)
 {
     Occurred   = occurred;
     Status     = status;
     StatusText = text;
 }
Beispiel #41
0
 public Campaign(string name, string productCode, int priceManipulationLimit, int duration, int targetSalesCount, Status status)
 {
     Name                   = name;
     ProductCode            = productCode;
     PriceManipulationLimit = priceManipulationLimit;
     Duration               = duration;
     TargetSalesCount       = targetSalesCount;
     Status                 = status;
 }
Beispiel #42
0
 public void SetStatus(Status status)
 {
     curStatus = status;
 }
 public void Reset(Status status)
 {
     this.Checksums.All(x => { x.Status = status; return(true); });
 }
Beispiel #44
0
    List <Node> SearchForRoute()
    {
        status = Status.searching;
        int timeOut = 0;

        while (!isComplete)
        {
            timeOut++;
            if (timeOut > 200)
            {
                isComplete = true;
                //This could be because you are trying to use a goal node that is inside a wall or the path was blocked
                Logger.Log(
                    $"Pathing finding could not find a path where one was expected to be found. StartNode {startNode.position} GoalNode {goalNode.position}",
                    Category.Movement);
                return(null);
            }

            if (frontierNodes.Count > 0)
            {
                Node currentNode = frontierNodes.Dequeue();

                if (currentNode.neighbors == null)
                {
                    FindNeighbours(currentNode);
                }

                if (!exploredNodes.Contains(currentNode))
                {
                    exploredNodes.Add(currentNode);
                }

                ExpandFrontierAStar(currentNode);

                if (pathFound)
                {
                    isComplete = true;
                    List <Node> path = new List <Node>();

                    Node nextNode = goalNode;

                    do
                    {
                        path.Add(nextNode);
                        nextNode = nextNode.previous;
                    } while (nextNode != null);

                    path.Reverse();

                    return(path);
                }
            }
            else
            {
                isComplete = true;
                return(null);
            }
        }

        status = Status.idle;
        return(null);
    }
Beispiel #45
0
 public void RMWCompletionCallback(ref long key, ref long input, Empty ctx, Status s)
 {
 }
Beispiel #46
0
 private void PublishEvent(string eventName, Status status)
 {
     _context.Clients.Group(_channel).OnEvent(eventName, status);
 }
Beispiel #47
0
 public virtual void Deactivate()
 {
     activated = false;
     status    = Status.idle;
 }
Beispiel #48
0
        /// <summary>
        /// Update status in database
        /// </summary>
        /// <param name="item">Status to update</param>
        /// <returns>Updated status</returns>
        public Status Update(Status item)
        {
            var statusToUpdate = this._context.Statuses.Update(item);

            return(statusToUpdate.Entity);
        }
        public TransitionScheme AddDefaultTransitionScheme()
        {
            var transitionScheme = new TransitionScheme()
            {
                Name      = Constants.DefaultSchemeName,
                IsDefault = true
            };

            var openStatus            = this.data.StatusRepository.Get(s => s.Name == DefaultTransitionSchemeStatuses.Open.ToString()).FirstOrDefault();
            var closedStatus          = this.data.StatusRepository.Get(s => s.Name == DefaultTransitionSchemeStatuses.Closed.ToString()).FirstOrDefault();
            var inProgressStatus      = this.data.StatusRepository.Get(s => s.Name == DefaultTransitionSchemeStatuses.InProgress.ToString()).FirstOrDefault();
            var stoppedProgressStatus = this.data.StatusRepository.Get(s => s.Name == DefaultTransitionSchemeStatuses.StoppedProgress.ToString()).FirstOrDefault();

            if (openStatus == null)
            {
                openStatus = new Status()
                {
                    Name = DefaultTransitionSchemeStatuses.Open.ToString()
                };
                this.data.StatusRepository.Insert(openStatus);
            }

            if (closedStatus == null)
            {
                closedStatus = new Status()
                {
                    Name = DefaultTransitionSchemeStatuses.Closed.ToString()
                };
                this.data.StatusRepository.Insert(closedStatus);
            }

            if (inProgressStatus == null)
            {
                inProgressStatus = new Status()
                {
                    Name = DefaultTransitionSchemeStatuses.InProgress.ToString()
                };
                this.data.StatusRepository.Insert(inProgressStatus);
            }

            if (stoppedProgressStatus == null)
            {
                stoppedProgressStatus = new Status()
                {
                    Name = DefaultTransitionSchemeStatuses.StoppedProgress.ToString()
                };
                this.data.StatusRepository.Insert(stoppedProgressStatus);
            }

            this.data.StatusTransitionRepository.Insert(new StatusTransition()
            {
                ParentStatus     = openStatus,
                ChildStatus      = closedStatus,
                TransitionScheme = transitionScheme
            });

            this.data.StatusTransitionRepository.Insert(new StatusTransition()
            {
                ParentStatus     = openStatus,
                ChildStatus      = inProgressStatus,
                TransitionScheme = transitionScheme
            });

            this.data.StatusTransitionRepository.Insert(new StatusTransition()
            {
                ParentStatus     = inProgressStatus,
                ChildStatus      = stoppedProgressStatus,
                TransitionScheme = transitionScheme
            });

            this.data.StatusTransitionRepository.Insert(new StatusTransition()
            {
                ParentStatus     = inProgressStatus,
                ChildStatus      = closedStatus,
                TransitionScheme = transitionScheme
            });

            this.data.StatusTransitionRepository.Insert(new StatusTransition()
            {
                ParentStatus     = stoppedProgressStatus,
                ChildStatus      = inProgressStatus,
                TransitionScheme = transitionScheme
            });

            this.data.StatusTransitionRepository.Insert(new StatusTransition()
            {
                ParentStatus     = stoppedProgressStatus,
                ChildStatus      = closedStatus,
                TransitionScheme = transitionScheme
            });

            this.data.TransitionSchemeRepository.Insert(transitionScheme);
            return(transitionScheme);
        }
Beispiel #50
0
 //------------------------------------------------------------------------
 public void LineTo(double x, double y)
 {
     m_vectorClipper.LineTo(upscale(x), upscale(y));
     m_status = Status.LineTo;
 }
Beispiel #51
0
 public void SetStatus(Status s)
 {
     Status = s;
 }
Beispiel #52
0
        private async void submitButton_Click(object sender, EventArgs e)
        {
            foreach (var control in this.Controls)
            {
                if (control is TextBox && (control as TextBox).Text == "" && !(control as TextBox).Equals(additionalInfoTextBox) && !(control as TextBox).Equals(phoneTextBox))
                {
                    var name = ((TextBox)control).Name.Replace("TextBox", "");
                    name = (string.Concat(name.Select(x => Char.IsUpper(x) ? " " + x : x.ToString())).TrimStart(' '));
                    name = Char.ToUpper(name[0]) + name.Substring(1).ToLower();

                    _toolTip.Show($"{name} is empty", (TextBox)control);
                    return;
                }
            }

            if (statusComboBox.SelectedItem == default)
            {
                _toolTip.Show("There is nothing selected", statusComboBox);
                return;
            }

            if (!double.TryParse(requestedSalaryTextBox.Text, out double result))
            {
                _toolTip.Show("Number in wrong format", requestedSalaryTextBox);
                return;
            }


            var    strSelItem = statusComboBox.SelectedItem.ToString().Split(' ');
            string status     = "";

            for (int i = 0; i < strSelItem.Length; i++)
            {
                status += Char.ToUpper(strSelItem[i][0]) + strSelItem[i].Substring(1);
            }

            Status enumStat = (Status)(Enum.Parse(typeof(Status), status));

            GenericResponse response = null;

            if (_id == default)
            {
                response = await ApiHelper.Instance.AddCandidateAsync(titleTextBox.Text, nameTextBox.Text, surnameTextBox.Text, educationTextBox.Text, specialtyTextBox.Text, phoneTextBox.Text, emailTextBox.Text, addressTextBox.Text, double.Parse(requestedSalaryTextBox.Text), (int)EvaluationNumericUpDown.Value, enumStat, additionalInfoTextBox.Text);
            }
            else
            {
                response = await ApiHelper.Instance.EditCandidateAsync(_id, titleTextBox.Text, nameTextBox.Text, surnameTextBox.Text, educationTextBox.Text, specialtyTextBox.Text, phoneTextBox.Text, emailTextBox.Text, addressTextBox.Text, double.Parse(requestedSalaryTextBox.Text), (int)EvaluationNumericUpDown.Value, enumStat, additionalInfoTextBox.Text);
            }

            if (response.Success)
            {
                LoadScreen(ScreenName.CandidatesScreen);
            }
            else
            {
                errorLabel.Text = "";
                foreach (var error in response.Errors)
                {
                    errorLabel.Text += error;
                }
                errorLabel.Visible = true;
            }
        }
Beispiel #53
0
        /// <summary>
        /// Create status in database
        /// </summary>
        /// <param name="item">Item to add</param>
        /// <returns>Status entity</returns>
        public Status Create(Status item)
        {
            var createdStatus = this._context.Statuses.Add(item);

            return(createdStatus.Entity);
        }
Beispiel #54
0
 public static bool IsFinishedStatus(Status status)
 {
     return(status == Status.Completed || status == Status.Cancelled);
 }
Beispiel #55
0
 //public bool FlipY { get { return _filpY; } set { _filpY = value; } }
 //--------------------------------------------------------------------
 public void Reset()
 {
     m_cellAARas.Reset();
     m_status = Status.Initial;
 }