Ejemplo n.º 1
1
 public MobileQueryPacket(StatusType type, Serial serial)
     : base(0x34, "Get Player Status", 10)
 {
     Stream.Write(0xEDEDEDED); // always 0xEDEDEDED in legacy client
     Stream.Write((byte)type);
     Stream.Write(serial);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// New status for Event type
 /// </summary>
 /// <param name="tevent">Event type</param>
 /// <param name="tstatus">Execution status</param>
 public void add(SolutionEventType tevent, StatusType tstatus)
 {
     if(!states.ContainsKey(tevent)) {
         states[tevent] = new SynchronizedCollection<StatusType>();
     }
     states[tevent].Add(tstatus);
 }
 public override void RenderRow (IRenderContext context, int rowIndex, StatusType statusType, int width, int height)
 {
     if (statusType == StatusType.Normal && rowIndex % 2 != 0) {
         context.Theme.RenderRule (context.Context, width, height);
     }
     base.RenderRow (context, rowIndex, statusType);
 }
Ejemplo n.º 4
0
        public void ThreadMain()
        {
            while (running)
            {
                try
                {
                    LastException = null;
                    type = StatusType.Running;
                    int toSleep = Run();
                    type = StatusType.Stopped;
                    Thread.Sleep(toSleep);
                }
                catch (Exception e)
                {
                    type = StatusType.Crashed;
                    LastException = e;
                    ExceptionTime = DateTime.Now;
                    if (!running)
                    {
                        break;
                    }
                    else
                    {
                        LogHelper.WriteLog(GetType().Name, e.ToString());
                        try
                        {

                            //Sleep a while to prevent fill the disk
                            Thread.Sleep(10000);
                        }
                        catch { }
                    }
                }
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Instantiates AccessKey with the parameterized properties
 /// </summary>
 /// <param name="userName">Name of the user the key is associated with.</param>
 /// <param name="accessKeyId">The ID for this access key.</param>
 /// <param name="status">The status of the access key. <code>Active</code> means the key is valid for API calls, while <code>Inactive</code> means it is not.</param>
 /// <param name="secretAccessKey">The secret key used to sign requests.</param>
 public AccessKey(string userName, string accessKeyId, StatusType status, string secretAccessKey)
 {
     _userName = userName;
     _accessKeyId = accessKeyId;
     _status = status;
     _secretAccessKey = secretAccessKey;
 }
        public OldTighteningResultUpload(Message message)
            : base(message)
        {
            string str = Data.Substring(2, 10);
            Int64 id = Int64.Parse(str.Trim());
            try {
                TighteningID = (UInt32)id;
            } catch {
                TighteningID = 0;
            }

            VIN = Data.Substring(14, 25);
            PSetNo = Convert.ToInt32(Data.Substring(41, 3));
            BatchCount = Convert.ToInt32(Data.Substring(46, 4));

            TorqueStatus = (StatusType)(int.Parse(Data.Substring(55, 1)));
            AngleStatus = (StatusType)(int.Parse(Data.Substring(58, 1)));
            Success = (TorqueStatus == StatusType.OK && AngleStatus == StatusType.OK);

            Torque = int.Parse(Data.Substring(61, 6)) / 100.0F;
            Angle = int.Parse(Data.Substring(69, 5));

            str = Data.Substring(76, 10);
            str += " ";
            str += Data.Substring(87, 8);
            Timestamp = Convert.ToDateTime(str);

            BatchStatus = (BatchStatusType)(Data[97] - 48);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Instantiates SigningCertificate with the parameterized properties
 /// </summary>
 /// <param name="userName">The name of the user the signing certificate is associated with.</param>
 /// <param name="certificateId">The ID for the signing certificate.</param>
 /// <param name="certificateBody">The contents of the signing certificate.</param>
 /// <param name="status">The status of the signing certificate. <code>Active</code> means the key is valid for API calls, while <code>Inactive</code> means it is not.</param>
 public SigningCertificate(string userName, string certificateId, string certificateBody, StatusType status)
 {
     _userName = userName;
     _certificateId = certificateId;
     _certificateBody = certificateBody;
     _status = status;
 }
Ejemplo n.º 8
0
 void OnTriggerExit2D(Collider2D other)
 {
     if (other.gameObject.tag == "Player") {
         Patrol ();
         currentStatus = StatusType.Patrol;
     }
 }
Ejemplo n.º 9
0
 void OnTriggerStay2D(Collider2D other)
 {
     if (other.gameObject.tag == "Player") {
         target = other.gameObject;
         currentStatus = StatusType.Trace;
     }
 }
Ejemplo n.º 10
0
        private static void UpdateCourseTopicAssignment(long? courseTopicAssignmentId, long? employeeCourseAssignmentId, int? courseTopicId, bool completed,
            StatusType section, int sequence)
        {

            DBHelper.ExecuteNonQuery(
                new SqlCommand()
                    .WithConnection(DBHelper.ConnectionString)
                    .ForProcedure("UpdateCourseTopicAssignment",
                        x => x.WithParam("@CourseTopicAssignmentID", courseTopicAssignmentId, id => id > 0)
                              .WithParam("@EmployeeCourseAssignmentID", employeeCourseAssignmentId, id => id > 0)
                              .WithParam("@CourseTopicID", courseTopicId, id => id > 0)
                              .WithParam("@Completed", completed)
                              .WithParam("@Started", (bool?)null)
                              .WithParam("@Notified", (bool?)null)
                              .WithParam("@Section", Translator.ToDBValue(section))
                              .WithParam("@SectionSequence", (byte)sequence)
                    ),
                true);
            //new SqlCommand(@"UpdateCourseTopicAssignment") { CommandType = CommandType.StoredProcedure },
            //new SqlParameter { ParameterName = "@CourseTopicAssignmentID", DbType = DbType.Int64, Value = ToParamValue(courseTopicAssignmentId, id => id > 0) },
            //new SqlParameter { ParameterName = "@EmployeeCourseAssignmentID", DbType = DbType.Int64, Value = ToParamValue(employeeCourseAssignmentId,id=>id>0) },
            //new SqlParameter { ParameterName = "@CourseTopicID", DbType = DbType.Int32, Value = OrDefault(courseTopicId,DBNull.Value,id=>id>0) },
            //new SqlParameter { ParameterName = "@Completed", DbType = DbType.Boolean, Value = completed },
            //new SqlParameter { ParameterName = "@Started", DbType = DbType.Boolean, Value = DBNull.Value },
            //new SqlParameter { ParameterName = "@Notified", DbType = DbType.Boolean, Value = DBNull.Value },
            //new SqlParameter { ParameterName = "@Section", DbType = DbType.String, Value = Translator.ToDBValue(section) },
            //new SqlParameter { ParameterName = "@SectionSequence", DbType = DbType.Byte, Value = sequence });
        }
Ejemplo n.º 11
0
 public StatusChangedEventArgs(string oldText, StatusType oldType, string text, StatusType type)
 {
     this.OldText = oldText;
     this.OldType = oldType;
     this.Text = text;
     this.Type = type;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 类型:方法
 /// 名称:UserInfo
 /// 作者:taixihuase
 /// 作用:通过参数值构造 UserInfo 对象
 /// 编写日期:2015/7/12
 /// </summary>
 /// <param name="guid"></param>
 /// <param name="uniqueId"></param>
 /// <param name="account"></param>
 /// <param name="nickname"></param>
 /// <param name="status"></param>
 public UserInfo(Guid guid, string account, int uniqueId = -1, string nickname = "", StatusType status = StatusType.Default)
 {
     Guid = guid;
     UniqueId = uniqueId;
     Account = account;
     Nickname = nickname;
     Status = status;
 }
Ejemplo n.º 13
0
 public AgreementException(StatusType status, FaultType fault, CommonOutputType commonOutput, RecordCommonOutputType recordCommonOutput)
     : base(status.Code == "200" || status.Code == "400" ? fault.Message.Value : status.Message.Single().Value)
 {
     this.status = status;
     this.fault = fault;
     this.commonOutput = commonOutput;
     this.recordCommonOutput = recordCommonOutput;
 }
Ejemplo n.º 14
0
        public StatusText(Unit owner, StatusType type, string text)
        {
            font = GameManager.TheGameManager.defaultFont;

            this.type = type;
            this.text = text;
            this.owner = owner;
            this.Position = owner.Center;
        }
Ejemplo n.º 15
0
        public IList<StatusType> Select(StatusType data)
        {
            IList<StatusType> datos = new List<StatusType>();
            datos = GetHsql(data).List<StatusType>();
            if (!Factory.IsTransactional)
                Factory.Commit();
            return datos;

        }
Ejemplo n.º 16
0
 public void AddEffect(StatusEffect newStatus)
 {
     newStatus.Countdown = newStatus.Duration;
     ActiveStatuses |= newStatus.Type;
     StatusEffectBlockModifier += newStatus.BlockModifier;
     StatusEffectCooldownModifier += newStatus.CooldownModifier;
     StatusEffectHitModifier += newStatus.HitModifier;
     Effects.Add(newStatus);
 }
        public StatusText(GameObject obj, StatusType type, string text)
        {
            font = GameManager.TheGameManager.Font;

            this.type = type;
            this.text = text;
            this.owner = obj;
            this.Position = owner.Center;
        }
Ejemplo n.º 18
0
        private string StatusToMessage(StatusType type)
        {
            var statusString = Helper.Translate("StatusType" + type.ToString());

            if (!string.IsNullOrEmpty(statusString))
                return statusString;

            return type.ToString();

        }
Ejemplo n.º 19
0
 public TUserVariable(TUserVariable origin)
     : this()
 {
     evaluated       = origin.evaluated;
     unevaluated     = origin.unevaluated;
     ident           = origin.ident;
     status          = origin.status;
     persistence     = origin.persistence;
     prev            = origin.prev;
 }
Ejemplo n.º 20
0
 public static char ToDBValue(StatusType section)
 {
     switch (section)
     {
         case StatusType.Presenting:
             return 'P';
         case StatusType.Testing:
             return 'T';
     }
     return 'P';  //This is for the compiler because this will never execute, but the compiler thinks that not all code paths return a value even though they do.
 }
 public AccountingRequest(string nasIpAddress, ServiceType serviceType, string userName,
     AuthenticationType authenticationType, StatusType statusType, uint delayTime, string clientIp, string sessionId, Client client)
     : base(PacketType.AccountingRequest, nasIpAddress, serviceType, userName)
 {
     Packet.Secret = client.Secret;
     Packet.Attributes.Add(new AuthenticationTypeAttribute(authenticationType));
     Packet.Attributes.Add(new StatusTypeAttribute(statusType));
     Packet.Attributes.Add(new IntegerAttribute(AttributeType.AcctDelayTime, delayTime));
     Packet.Attributes.Add(new IpAddressAttribute(AttributeType.FramedIpAddress, clientIp));
     Packet.Attributes.Add(new StringAttribute(AttributeType.AcctSessionId, sessionId));
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="User"/> class.
 /// </summary>
 /// <param name="age">The age.</param>
 /// <param name="sexType">Type of the sex.</param>
 /// <param name="statusType">Type of the status.</param>
 /// <param name="applicationId">The application id.</param>
 /// <param name="version">The version.</param>
 public User(int age, SexType sexType,
     StatusType statusType, Guid applicationId, Guid sessionId, String version)
 {
     this.ApplicationId = applicationId;
     this.Version = version;
     this.Age = age;
     this.Sex = sexType;
     this.Status = statusType;
     this.DateCreated = DateTime.Now;
     this.SessionId = sessionId;
 }
Ejemplo n.º 23
0
        public void Read(string[] fields)
        {
            if (fields.Length != 13)
            {
                throw new InvalidDataException(string.Format("$GPRMC sentence needs to have 13 fields, but {0} were found.", fields.Length));
            }

            int n = 0;

            if (fields[n] != "$GPRMC")
                throw new InvalidDataException(string.Format("Expected \"$GPRMC\", found \"{0}\"", fields[n]));
            n++;

            TimeSpan time = ParseTime(fields[n]);
            n++;

            if (fields[n] == "A")
                Status = StatusType.Active;
            else if (fields[n] == "V")
                Status = StatusType.Void;
            else
                throw new InvalidDataException(string.Format("Unknown status \"{0}\"", fields[n]));
            n++;

            Latitude = ParseLatitude(fields[n], fields[n + 1]);
            n += 2;

            Longitude = ParseLongitude(fields[n], fields[n + 1]);
            n += 2;

            double speed;
            if (double.TryParse(fields[n], out speed))
                GroundSpeedKnots = speed;
            n++;

            double angle;
            if (double.TryParse(fields[n], out angle))
                TrackAngle = angle;
            n++;

            int day = int.Parse(fields[n].Substring(0, 2));
            int month = int.Parse(fields[n].Substring(2, 2));
            int year = int.Parse(fields[n].Substring(4, 2));

            if (year > 90)
                year += 1900;
            else
                year += 2000;

            DateTime = new DateTime(year, month, day, time.Hours, time.Minutes, time.Seconds, time.Milliseconds, DateTimeKind.Utc);

            //Magnetic variation not implemented
            //Fix kind not implemented
        }
        public LastTighteningResultUpload(Message message)
            : base(message)
        {
            string str;

            TorqueEventArgs args = new TorqueEventArgs();

            CellID = Convert.ToInt32(Data.Substring(2, 4));
            ChannelID = Convert.ToInt32(Data.Substring(8, 2));

            ControllerName = Data.Substring(12, 25);
            VIN = Data.Substring(39, 25);

            JobNo = Convert.ToInt32(Data.Substring(66, 2));
            PSetNo = Convert.ToInt32(Data.Substring(70, 3));
            BatchSize = Convert.ToInt32(Data.Substring(75, 4));
            BatchCount = Convert.ToInt32(Data.Substring(81, 4));

            TorqueStatus = (StatusType)(int.Parse(Data.Substring(90, 1)));
            AngleStatus = (StatusType)(int.Parse(Data.Substring(93, 1)));
            Success = (TorqueStatus == StatusType.OK && AngleStatus == StatusType.OK);

            TorqueMin = int.Parse(Data.Substring(96, 6)) / 100.0F;
            TorqueMax = int.Parse(Data.Substring(104, 6)) / 100.0F;
            TorqueTarget = int.Parse(Data.Substring(112, 6)) / 100.0F;
            Torque = int.Parse(Data.Substring(120, 6)) / 100.0F;

            AngleMin = int.Parse(Data.Substring(128, 6));
            AngleMax = int.Parse(Data.Substring(135, 6));
            AngleTarget = int.Parse(Data.Substring(142, 6));
            Angle = int.Parse(Data.Substring(149, 5));

            str = Data.Substring(156, 10);
            str += " ";
            str += Data.Substring(167, 8);
            Timestamp = Convert.ToDateTime(str);

            str = Data.Substring(177, 10);
            str += " ";
            str += Data.Substring(188, 8);
            LastPSetChange = Convert.ToDateTime(str);

            BatchStatus = (BatchStatusType)(Data[198] - 48);

            str = Data.Substring(201, 10);
            Int64 id = Int64.Parse(str.Trim());
            try {
                TighteningID = (UInt32)id;
            } catch {
                TighteningID = 0;
            }
        }
        public UsageResponseInfo(string version, StatusType status, DateTime creationTime, int bitsLeft, int requestsLeft, int totalBits, int totalRequests, int id)
        {
            Version = version;
            Status = status;
            CreationTime = creationTime;
            BitsLeft = bitsLeft;
            RequestsLeft = requestsLeft;
            TotalBits = totalBits;
            TotalRequests = totalRequests;
            Id = id;

            // Usage method does not return Advisory Delay so always set it to zero
            AdvisoryDelay = 0;
        }
        internal DistributedStateEngine.Status.Status Create(StatusType statusType, Server context)
        {
            switch (statusType)
            {
                case StatusType.Follower:
                    return new FollowerStatus(context);
                case StatusType.Candidate:
                    return new CandidateStatus(context);
                case StatusType.Leader:
                    return new LeaderStatus(context);
            }

            throw new InvalidOperationException("Unexpected state.");
        }
Ejemplo n.º 27
0
 public static char? ToDBValue(StatusType? section)
 {
     if (section.HasValue)
     {
         switch (section)
         {
             case StatusType.Testing:
                 return 'T';
             case StatusType.Presenting:
             default:
                 return 'P';
         }
     }
     return null;
 }
 public string GetStatusImageUrl(StatusType type)
 {
     switch (type)
     {
         case StatusType.LAR:
             return "~/images/LimitedAuthorisedReseller.gif";
             break;
         case StatusType.AASP:
             return "~/images/AuthorisedServiceProvider.gif";
             break;
         case StatusType.ACP:
             return "~/images/AuthorisedCollectionPoint.gif";
             break;
         default:
             return "";
             break;
     }
 }
Ejemplo n.º 29
0
        public void SetStatusString(StatusType type, string text, params object[] args)
        {
            var t = WB.Form.ActiveToolbar;
            t.Invoke(() =>
                {
                    t.HighlightStatusString = true;
                    t.StatusString = args != null && args.Length > 0 ? String.Format(text, args) : text;
                    t.StatusImage = type == StatusType.Error ? Bitmaps.Load("Error") :
                                    type == StatusType.Warning ? Bitmaps.Load("Warning") :
                                    Bitmaps.Load("Message");

                    if (type == StatusType.Error)
                        SystemSounds.Exclamation.Play();

                    if (type == StatusType.Warning)
                        SystemSounds.Beep.Play();

                    t.Refresh();
                });
        }
        public StatusType DownloadSignedFile(long transactionId)
        {
            StatusType retorno;
            try
            {
                var uri = string.Format(@"http://{0}/mss/restAp{1}/document/signed/{2}", SignatureService.certillionDomain, SignatureService.certillionSufix, transactionId);
                var fileNameSigned = string.Format(txtCaminhoArquivo.Text.Replace(".pdf", "-Signed-{0}.pdf"), transactionId);

                // Implementação de baixa do arquivo assinado via WebClient
                using (var client = new WebClient())
                {
                    var bufferData = client.DownloadData(uri);
                    File.WriteAllBytes(fileNameSigned, bufferData);
                }
                retorno = new StatusType() { StatusCode = 100, StatusDetail = string.Format(@"Arquivo salvo como " + fileNameSigned, transactionId), StatusMessage = "REQUEST_OK" };
            }
            catch (Exception ex)
            {
                retorno = new StatusType() { StatusCode = 500, StatusDetail = ex.Message, StatusMessage = "ERROR" };
            }
            return retorno;
        }
Ejemplo n.º 31
0
        private IEnumerator FindNextHeat(string hash)
        {
            Debug.Log(string.Format("[BDArmory.BDAScoreService] Find next heat for {0}", hash));

            status = StatusType.FetchingHeat;
            // fetch heat metadata
            yield return(client.GetHeats(hash));

            // find an unstarted heat
            HeatModel model = client.heats.Values.FirstOrDefault(e => e.Available());

            if (model == null)
            {
                status = StatusType.StalledNoPendingHeats;
                Debug.Log(string.Format("[BDArmory.BDAScoreService] No inactive heat found {0}", hash));
                yield return(RetryFind(hash));
            }
            else
            {
                Debug.Log(string.Format("[BDArmory.BDAScoreService] Found heat {1} in {0}", hash, model.order));
                yield return(FetchAndExecuteHeat(hash, model));
            }
        }
Ejemplo n.º 32
0
            protected virtual void Start()
            {
                try
                {
                    if (Status == StatusType.NotStarted)
                    {
                        throw new Exception("Stream has not been queued.");
                    }
                    _Status = StatusType.Starting;

                    if (!StopWatch.IsRunning)
                    {
                        StopWatch.Start();
                    }

                    InvokeOnProgressStarted();
                    InvokeOnProgressChanged();
                }
                catch (Exception exception)
                {
                    Log.Error(exception);
                }
            }
Ejemplo n.º 33
0
        private void SetStatusMessage(StatusType status, string message)
        {
            if (status == StatusType.Loading)
            {
                LoadingSpinner.Start();
            }
            else
            {
                LoadingSpinner.Stop();
            }

            UIUtils.SetElementDisplay(LoadingIcon, status == StatusType.Error);
            if (status == StatusType.Error)
            {
                LoadingText.AddToClassList("icon");
            }
            else
            {
                LoadingText.RemoveFromClassList("icon");
            }

            LoadingText.text = message;
        }
Ejemplo n.º 34
0
        private IEnumerator EndTurn()
        {
            GameFlowData.Get().gameState = GameState.EndingTurn;
            ArtemisServerResolutionManager.Get().ApplyActions();

            // Iterate over each player in the game
            foreach (ActorData actor in GameFlowData.Get().GetActors())
            {
                // Update statuses
                var actorStatus = actor.GetActorStatus();
                for (StatusType status = 0; status < StatusType.NUM; status++)
                {
                    if (actorStatus.HasStatus(status))
                    {
                        int duration = Math.Max(0, actorStatus.GetDurationOfStatus(status) - 1);
                        actorStatus.UpdateStatusDuration(status, duration);
                        if (duration == 0)
                        {
                            do
                            {
                                actorStatus.RemoveStatus(status);
                            } while (actorStatus.HasStatus(status));
                            Log.Info($"{actor.DisplayName}'s {status} status has expired.");
                        }
                    }
                }
                // Progress the cooldowns
                AbilityData actorAbilityData = actor.GetAbilityData();
                actorAbilityData.ProgressCooldowns();

                // Apply energy/tech point regen effects
                int newTechPoints = actor.TechPoints + actor.m_techPointRegen;
                Log.Info($"{actor.DisplayName} regens ${actor.m_techPointRegen} tech points");
                actor.SetTechPoints(newTechPoints);
            }
            yield return(null);
        }
Ejemplo n.º 35
0
        private long Save(long Id, ref Order orderToUpdate, StatusType statustype, OrderedProduct[] newItems, string Seats,
                          OrderedProduct[] oldItems, ref bool needBill, int Status = 0)
        {
            long newId = 0;


            //if (TryUpdateModel(orderToUpdate, "", new string[] { "Status", "Seats", "TotalAmount" }
            //   ))
            //{
            if (oldItems != null)
            {
                UpdateDeletedItem(oldItems, orderToUpdate, ref needBill);
            }
            if (newItems != null)
            {
                UpdateOrderedProducts(newItems, orderToUpdate, ref needBill);
            }

            orderToUpdate.Seats = Seats;
            orderToUpdate.SetStatusType(statustype);
            if (Id == 0)
            {
                db.Entry(orderToUpdate).State = EntityState.Added;
            }
            else
            {
                db.Entry(orderToUpdate).State = EntityState.Modified;
            }

            db.SaveChanges();
            newId = db.Entry(orderToUpdate).Entity.Id;

            //}


            return(newId);
        }
Ejemplo n.º 36
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            StatusType  state      = (StatusType)value;
            LocalStatus localState = (LocalStatus)Enum.Parse(typeof(LocalStatus), value.ToString());

            switch (state)
            {
            case (StatusType.Added):
                if (localState == LocalStatus.Added)
                {
                    return(new SolidColorBrush(Colors.Green));
                }
                break;

            case (StatusType.Deleted):
                if (localState == LocalStatus.Deleted)
                {
                    return(new SolidColorBrush(Colors.Red));
                }
                break;

            case (StatusType.Ok):
                if (localState == LocalStatus.Ok)
                {
                    return(new SolidColorBrush(Colors.Black));
                }
                break;

            case (StatusType.Updated):
                if (localState == LocalStatus.Updated)
                {
                    return(new SolidColorBrush(Colors.Blue));
                }
                break;
            }
            return(new SolidColorBrush(Colors.Black));
        }
Ejemplo n.º 37
0
    /// <summary>
    /// 해당 유닛의 Status를 target으로 변경합니다.
    /// </summary>
    /// <param name="type">변경하고자 하는 StatusType</param>
    /// <param name="target">목표 도달 수치</param>
    public void ChangeStatTo(StatusType type, float target)
    {
        switch (type)
        {
        case StatusType.MHP:
            maxHp = (int)target;
            break;

        case StatusType.CHP:
            curHp = (int)target;
            break;

        case StatusType.SPD:
            spd = target;
            break;

        case StatusType.ATK:
            atk = target;
            break;

        case StatusType.DEF:
            def = target;
            break;

        case StatusType.CRT:
            crt = target;
            break;

        case StatusType.DDG:
            ddg = target;
            break;

        default:
            Debug.LogError("Something is Wrong at Changing Status");
            break;
        }
    }
Ejemplo n.º 38
0
    private Status Get強化補正値()
    {
        var status = new Status();

        foreach (var item in buffs)
        {
            StatusType statusType = item.statusType;
            int        value      = item.value;

            switch (statusType)
            {
            case StatusType.最大HP:
                status.maxHp += value;
                break;

            case StatusType.最大MP:
                status.maxMp += value;
                break;

            case StatusType.攻撃:
                status.attack += value;
                break;

            case StatusType.守備:
                status.deffence += value;
                break;

            case StatusType.速さ:
                status.speed += value;
                break;

            default:
                break;
            }
        }
        return(status);
    }
Ejemplo n.º 39
0
        protected virtual string GetEmailBody(string note, Booking booking, StatusType type)
        {
            User   partner = booking.Partner;
            string content = string.Format("Hello {0}, <br />", partner.FullName);

            switch (type)
            {
            case StatusType.Pending:
                content =
                    string.Format(
                        "{0} Thank you for booking from OrientalSails.com.<br /> Your order number is {1} <br />",
                        content, booking.Id);
                content =
                    string.Format(
                        "{0} Please do not reply to this email. For questions or comments, please go to OrientalSails.com. <br />",
                        content);
                content =
                    string.Format(
                        "{0} Your order is pending. We will send you email after. <br /> This is your tour: <br /> {1}",
                        content, booking.Trip.Name);
                content = string.Format("{0}<br /> Thank you for booking from OrientalSails.com! <br />", content);
                break;

            case StatusType.Approved:
                content = string.Format("{0} Your order number is {1} has been approved <br />", content, booking.Id);
                break;

            case StatusType.Cancelled:
                content = string.Format("{0} Your order number is {1} has been canceled <br />", content, booking.Id);
                break;

            default:
                break;
            }

            return(content);
        }
Ejemplo n.º 40
0
    /// <summary>
    /// 해당 유닛의 Status를 amount만큼 변경합니다. amount가 양수일 경우 더해지고 음수일 경우 뺍니다.
    /// </summary>
    /// <param name="type">변경하고자 하는 StatusType</param>
    /// <param name="amount">변경하고자 하는 양</param>
    public void ChangeStat(StatusType type, float amount)
    {
        switch (type)
        {
        case StatusType.MHP:
            maxHp += (int)amount;
            break;

        case StatusType.CHP:
            curHp += (int)amount;
            break;

        case StatusType.SPD:
            spd += amount;
            break;

        case StatusType.ATK:
            atk += amount;
            break;

        case StatusType.DEF:
            def += amount;
            break;

        case StatusType.CRT:
            crt += amount;
            break;

        case StatusType.DDG:
            ddg += amount;
            break;

        default:
            Debug.LogError("Something is Wrong at Changing Status");
            break;
        }
    }
        protected virtual InitiativeStatus?GetInitiativeStatusForRemedyStatus(StatusType remedyStatusType)
        {
            // here we have the business logic of translating Remedy statuses into our statuses
            InitiativeStatus newIdeaStatus;

            switch (remedyStatusType)
            {
            case StatusType.Assigned:
                newIdeaStatus = InitiativeStatus.Submit;
                break;

            case StatusType.Cancelled:
                newIdeaStatus = InitiativeStatus.Cancelled;
                break;

            case StatusType.Planning:
                newIdeaStatus = InitiativeStatus.Review;
                break;

            case StatusType.InProgress:
                newIdeaStatus = InitiativeStatus.Collaborate;
                break;

            case StatusType.Completed:
                newIdeaStatus = InitiativeStatus.Deliver;
                break;

            case StatusType.Closed:
            case StatusType.Pending:
            case StatusType.Rejected:
            case StatusType.WaitingApproval:
            default:
                return(null);    // no change
            }
            return(newIdeaStatus);
        }
Ejemplo n.º 42
0
            protected void DriveService_ProgressChanged(StatusType status, Exception processException)
            {
                try
                {
                    UpdateProgress(status, BytesProcessed, TotalBytes, processException);

                    if (Processed)
                    {
                        try
                        {
                            if (Completed)
                            {
                                _DriveService.CleanupFile(FileInfo, true);

                                API.DriveService.Journal.RemoveItem(FileInfo.Id);
                            }
                        }
                        catch (Exception exception)
                        {
                            Log.Error(exception, false);

                            if (!Failed)
                            {
                                _ExceptionMessage = exception.Message;
                                _Status           = StatusType.Failed;
                            }
                        }
                    }

                    InvokeOnProgressEvent();
                }
                catch (Exception exception)
                {
                    Log.Error(exception, false);
                }
            }
Ejemplo n.º 43
0
        override public HandlerResult Execute(string parms, bool dryRun = false)
        {
            StatusType st     = StatusType.Failed;
            bool       cancel = OnProgress("FooExecute", getMsg(StatusType.Initializing, dryRun), StatusType.Initializing);

            if (!cancel)
            {
                OnProgress("FooExecute", getMsg(StatusType.Running, dryRun), StatusType.Running);
                if (!dryRun)
                {
                    OnProgress("FooExecute", "...Progress...", StatusType.Running);
                }
                OnProgress("FooExecute", "Finished", st);
            }
            else
            {
                st = StatusType.Cancelled;
                OnProgress("FooExecute", "Cancelled", st);
            }
            return(new HandlerResult()
            {
                Status = st
            });
        }
Ejemplo n.º 44
0
        public void TestQuery()
        {
            IptDataModel client   = new IptDataModelClient();
            QueryRequest qRequest = new QueryRequest();

            // Header
            SIFHeaderType header = createHeader();

            header.TopicName              = "SchoolCourseInfo";
            header.MaxBufferSize          = uint.MaxValue;
            header.MaxBufferSizeSpecified = true;
            header.ResponseVersion        = new String[] { "1.1", "2.0r1", "2.1", "2.5", "2.*" };
            qRequest.SIFHeader            = header;

            // Query
            QueryTypeQueryObject query = new QueryTypeQueryObject();

            query.ObjectName = "SchoolCourseInfo";
            QueryType type = new QueryType();

            type.QueryObject = query;


            qRequest.Query = type;

            EventStatus evStatus = client.Query(qRequest);

            runAssertions(evStatus.SIFHeader);
            Assert.IsNotNull(evStatus.Status, "Status is null");
            StatusType status = evStatus.Status;

            Console.WriteLine("Invoked with return code " + status.Code);

            Assert.AreEqual(status.Code, InfrastructureStatusCodeType.Item0);
            Assert.AreEqual(status.Desc, "Success");
        }
Ejemplo n.º 45
0
        /// <summary>
        /// Convert role status
        /// </summary>
        private CS <RoleStatus> ConvertRoleStatusCode(StatusType statusType)
        {
            // Status
            switch (statusType)
            {
            case StatusType.Active:
                return(RoleStatus.Active);

            case StatusType.Cancelled:
                return(RoleStatus.Cancelled);

            case StatusType.Nullified:
                return(RoleStatus.Nullified);

            case StatusType.New:
                return(RoleStatus.Pending);

            case StatusType.Cancelled | StatusType.Active:
                return(RoleStatus.Suspended);

            case StatusType.Cancelled | StatusType.Obsolete:
                return(RoleStatus.Terminated);

            case StatusType.Unknown:
                return(new CS <RoleStatus>()
                {
                    NullFlavor = NullFlavor.Unknown
                });

            default:
                return(new CS <RoleStatus>()
                {
                    NullFlavor = NullFlavor.Other
                });
            }
        }
Ejemplo n.º 46
0
        public void ConvertHTMLFromWord(object Source, object Target)
        {
            if (Word == null)                         // Check for the prior instance of the OfficeWord Object
            {
                Word = new Microsoft.Office.Interop.Word.Application();
            }

            try
            {
                // To suppress window display the following code will help
                Word.Visible             = false;
                Word.Application.Visible = false;
                Word.WindowState         = Microsoft.Office.Interop.Word.WdWindowState.wdWindowStateMinimize;

                Word.Documents.Open(ref Source, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown);

                object format = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatHTML;

                Word.ActiveDocument.SaveAs(ref Target, ref format, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown);

                Status  = StatusType.SUCCESS;
                Message = Status.ToString();
            }
            catch (Exception e)
            {
                Message = "Error :" + e.Message.ToString().Trim();
            }
            finally
            {
                if (Word != null)
                {
                    Word.Documents.Close(ref Unknown, ref Unknown, ref Unknown);
                    Word.Quit(ref Unknown, ref Unknown, ref Unknown);
                }
            }
        }
Ejemplo n.º 47
0
        private void Wait(TraceBackFrame frame, string result, object payload)
        {
            _currpoint = new BreakPoint(frame);

            var pt = _currpoint;

            _frames = new List <StackFrame>();
            int i = 1000;

            while (pt != null)
            {
                var path = pt.Path;
                _frames.Add(
                    new StackFrame
                {
                    Id     = i++,
                    Name   = pt.FunctionName,
                    Line   = pt.Line,
                    Source = new Source {
                        Name = Path.GetFileName(path), Path = path
                    }
                });
                pt = pt.BackPoint;
            }

            _values = ValueTree.GetValues(frame);

            Status = StatusType.Wait;
            Stop(StoppedEvent.ReasonValue.Step);
            _resetEvent.WaitOne();

            if (Status == StatusType.Stop)
            {
                throw new System.Exception("调试中断!");
            }
        }
        public async Task <Response <int> > AddStatusType(StatusType statustype)
        {
            try
            {
                await _context.StatusType.AddAsync(statustype);

                await _context.SaveChangesAsync();

                return(new Response <int>()
                {
                    IsSuccess = true,
                    Model = statustype.Status_Type_Id
                });
            }
            catch (Exception ex)
            {
                _log.Error(ex, _user.GetCurrentUser().User_Name);
                return(new Response <int>()
                {
                    IsSuccess = false,
                    Message = ex.Message
                });
            }
        }
Ejemplo n.º 49
0
        public StatusBar(Vector2 position, string statusText, StatusType type)
        {
            _position   = position;
            _statusText = statusText;
            _textHeight = (byte)ContentManager.Instance.Fonts[ContentManager.FontTypes.Game].MeasureString(_statusText).Y;

            Type = type;

            switch (type)
            {
            case StatusType.Health:
                _currValue = (int)GameManager.Instance.GameScreen.Player.Stats.Health;
                break;

            case StatusType.Sanity:
                _currValue = GameManager.Instance.GameScreen.Player.Stats.Sanity;
                break;

            case StatusType.Hunger:
                _currValue = GameManager.Instance.GameScreen.Player.Stats.Hunger;
                break;

            case StatusType.Thirst:
                _currValue = GameManager.Instance.GameScreen.Player.Stats.Thirst;
                break;

            case StatusType.Bladder:
                _currValue = GameManager.Instance.GameScreen.Player.Stats.Bladder;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }

            _lastValue = _currValue;
        }
Ejemplo n.º 50
0
        public static int GetStatusUpTakeDamageAddValue(StatusType statusType, int level)
        {
            switch (statusType)
            {
            case StatusType.HitPoint:
                return(20 * level + 30);

            case StatusType.Attack:
                return(2 * level + 3);

            case StatusType.Defense:
                return(2 * level + 3);

            case StatusType.Evasion:
                return(1 * level);

            case StatusType.Critical:
                return(1 * level);

            default:
                Assert.IsTrue(false, $"{statusType}は未対応です");
                return(0);
            }
        }
Ejemplo n.º 51
0
        public IntReactiveProperty Get(StatusType statusType)
        {
            switch (statusType)
            {
            case StatusType.HitPoint:
                return(hitPoint);

            case StatusType.Attack:
                return(attack);

            case StatusType.Defense:
                return(defense);

            case StatusType.Evasion:
                return(evasion);

            case StatusType.Critical:
                return(critical);

            default:
                Assert.IsTrue(false, $"{statusType}は未対応です");
                return(null);
            }
        }
Ejemplo n.º 52
0
 public static Status Set(StatusType type) => new Status(type, 0);
Ejemplo n.º 53
0
        void RunPlanCompareExpected(string planFile)
        {
            // Arrange
            Plan plan = Plan.FromYaml($"{__plansRoot}\\{planFile}");

            // Act
            plan.Start(null, true, true);

            // Assert
            Dictionary <string, StatusType> expectedStatus = new Dictionary <string, StatusType>();
            Dictionary <string, StatusType> actualStatus   = new Dictionary <string, StatusType>();

            StatusType maxStatus = StatusType.None;

            Stack <List <ActionItem> > actionLists = new Stack <List <ActionItem> >();
            Plan expectedResultsPlan = Plan.FromYaml($"{__plansOut}\\{plan.Name}_expected.yaml");

            actionLists.Push(expectedResultsPlan.Actions);
            while (actionLists.Count > 0)
            {
                List <ActionItem> actions = actionLists.Pop();
                foreach (ActionItem a in actions)
                {
                    expectedStatus.Add(a.Name, StatusType.None);
                    if (a.HasParameters && a.Parameters.HasValues)
                    {
                        expectedStatus[a.Name] = (StatusType)Enum.Parse(typeof(StatusType),
                                                                        ((Dictionary <object, object>)a.Parameters.Values)["ReturnStatus"].ToString());
                    }
                    if (a.HasActionGroup)
                    {
                        if (expectedStatus.ContainsKey(a.ActionGroup.Name))
                        {
                            if (expectedStatus[a.ActionGroup.Name] < a.ActionGroup.Result.BranchStatus)
                            {
                                expectedStatus[a.ActionGroup.Name] = a.ActionGroup.Result.BranchStatus;
                            }
                        }
                        else
                        {
                            expectedStatus.Add(a.ActionGroup.Name, a.ActionGroup.Result.BranchStatus);
                        }
                        //actionLists.Push( new List<ActionItem>( new ActionItem[] { a.ActionGroup } ) );

                        if ((int)expectedStatus[a.ActionGroup.Name] > (int)maxStatus)
                        {
                            maxStatus = expectedStatus[a.ActionGroup.Name];
                        }
                    }
                    if (a.HasActions)
                    {
                        actionLists.Push(a.Actions);
                    }

                    if ((int)expectedStatus[a.Name] > (int)maxStatus)
                    {
                        maxStatus = expectedStatus[a.Name];
                    }
                }
            }
            actionLists.Push(plan.ResultPlan.Actions);
            while (actionLists.Count > 0)
            {
                List <ActionItem> actions = actionLists.Pop();
                foreach (ActionItem a in actions)
                {
                    actualStatus.Add(a.Name, a.Result.Status);
                    if (a.HasActionGroup)
                    {
                        if (actualStatus.ContainsKey(a.ActionGroup.Name))
                        {
                            if (actualStatus[a.ActionGroup.Name] < a.ActionGroup.Result.BranchStatus)
                            {
                                actualStatus[a.ActionGroup.Name] = a.ActionGroup.Result.BranchStatus;
                            }
                        }
                        else
                        {
                            actualStatus.Add(a.ActionGroup.Name, a.ActionGroup.Result.BranchStatus);
                        }
                        //actionLists.Push( new List<ActionItem>( new ActionItem[] { a.ActionGroup } ) );

                        if ((int)expectedStatus[a.ActionGroup.Name] > (int)maxStatus)
                        {
                            maxStatus = expectedStatus[a.ActionGroup.Name];
                        }
                    }
                    if (a.HasActions)
                    {
                        actionLists.Push(a.Actions);
                    }
                }
            }

            string planResult = plan.ResultPlan.ToYaml();

            File.WriteAllText($"{__plansOut}\\{plan.Name}_out.yaml", plan.ResultPlan.ToYaml());

            Assert.AreEqual(maxStatus, plan.Result.Status);
            Assert.AreEqual(expectedStatus.Count, actualStatus.Count);
            foreach (string key in expectedStatus.Keys)
            {
                Assert.AreEqual(expectedStatus[key], actualStatus[key]);
            }
        }
Ejemplo n.º 54
0
 public void Cancel()
 {
     _worker.Abort();
     _status = StatusType.Canceled;
 }
Ejemplo n.º 55
0
 public static StatusTypeEnum ToStatusTypeEnum(this StatusType statusType)
 {
     return((StatusTypeEnum)((int)statusType));
 }
Ejemplo n.º 56
0
 /// <summary>
 /// 重新初始化实例。
 /// </summary>
 /// <param name="type">类型状态。</param>
 /// <param name="message">消息实例。</param>
 public void Reinitialize(StatusType type, string message)
 {
     _statusType = type;
     _message    = message;
 }
Ejemplo n.º 57
0
 public Status(StatusType type, ushort percentage)
 {
     Type       = type;
     Percentage = Guard.InRangeAndNotNull(nameof(percentage), percentage, 0, 100);
 }
 public Task <Response <bool> > UpdateStatusType(StatusType statustype)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 59
0
 public static void SetStatusType(this Order order, StatusType statustype)
 {
     order.Status = (byte)statustype;
 }
Ejemplo n.º 60
0
 public static Status Completed(StatusType type) => new Status(type, 100);