示例#1
0
 public Conditions(Entity target, Entity caster, cType type)
 {
     Target = target;
     Caster = caster;
     Type   = type;
     Target.conditions.Add(this);
 }
示例#2
0
        public BitmapOperations(cType inp)
        {
            InitializeComponent();

            this.inp = inp;
            setDetails(inp, true);
        }
示例#3
0
        public void setFormats(cType input)
        {
            switch (input.classType)
            {
            case classTypes.DDS:
                DDS inpDDS = input as DDS;
                formats = getDDSFormats();
                comboBoxFormat.Items.Clear();
                foreach (formatTypes ft in formats)
                {
                    if (ft.compressed == inpDDS.Compressed &&
                        ft.bits == inpDDS.BitsPerPixel)
                    {
                        comboBoxFormat.Items.Add(ft.name);
                    }
                }
                break;

            case classTypes.Jpeg:
                break;

            case classTypes.Bitmap:
                break;
            }
        }
示例#4
0
        public BitmapOperations(cType inp)
        {
            InitializeComponent();

            this.inp = inp;
            setDetails(inp, true);
        }
示例#5
0
 public cType Register1_GetVehicleType(string pSerijskaSt)
 {
     try
     {
         cType lType = cNonServiceLogic.GetVehicleType(mVehicles, pSerijskaSt);
         if (lType != null)
         {
             return(lType);
         }
         cNonServiceLogic.ThrowNapaka(new StackTrace().GetFrame(1).GetMethod().Name, "Vozilo ne obstaja!");
         return(null);
     }
     catch (TimeoutException lTimeNapaka)
     {
         cNonServiceLogic.ThrowNapaka(lTimeNapaka.StackTrace, lTimeNapaka.Message);
         return(null);
     }
     catch (FaultException <FaultNapaka> lFENapaka)
     {
         cNonServiceLogic.ThrowNapaka(lFENapaka.StackTrace, lFENapaka.Message);
         return(null);
     }
     catch (CommunicationException lComNapaka)
     {
         cNonServiceLogic.ThrowNapaka(lComNapaka.StackTrace, lComNapaka.Message);
         return(null);
     }
     catch (Exception lEx)
     {
         cNonServiceLogic.ThrowNapaka(lEx.StackTrace, lEx.Message);
         return(null);
     }
 }
示例#6
0
        public static int CalculateDifference(cType one, cType two)
        {
            ExtendendList <cType> cTmp = new ExtendendList <cType>();

            foreach (string item in Enum.GetNames(typeof(cType)))
            {
                cType tmp = cType.Default;
                if (Enum.TryParse <cType>(item, out tmp))
                {
                    cTmp.Add(tmp);
                }
            }
            return(Structure.Abs(cTmp.IndexOf(one) - cTmp.IndexOf(two)));
        }
示例#7
0
        public cType convert(cType inputType)
        {
            Bitmap bm = null;

            // Decoding section
            if (inputType is DDS)
            {
                //bm = DDSRead(inputType as DDS);
                DDSConvert(inp, outp);
            }
            else if (inputType is JPG)
            {
                bm = new Bitmap(inputType.stream);
            }
            else if (inputType is BMP)
            {
                bm = new Bitmap(inputType.stream);
            }

            // Encoding section
            bm.Save(outp.stream, System.Drawing.Imaging.ImageFormat.Bmp);
            if (outp is DDS)
            {
                DDS inp = inputType as DDS;
                //switch (formats) { }

                return(outp);
            }
            else if (outp is JPG)
            {
                cType outputType = new JPG();
                bm.Save(outp.stream, System.Drawing.Imaging.ImageFormat.Jpeg);
                return(outputType);
            }
            else if (outp is BMP)
            {
                cType outputType = new BMP();
                bm.Save(outp.stream, System.Drawing.Imaging.ImageFormat.Bmp);
                return(outputType);
            }

            return(null);
        }
示例#8
0
        public cType convert(cType inputType)
        {
            Bitmap bm = null;

            // Decoding section
            if (inputType is DDS)
            {
                //bm = DDSRead(inputType as DDS);
                DDSConvert(inp, outp);
            }
            else if (inputType is JPG)
                bm = new Bitmap(inputType.stream);
            else if (inputType is BMP)
                bm = new Bitmap(inputType.stream);

            // Encoding section
            bm.Save(outp.stream, System.Drawing.Imaging.ImageFormat.Bmp);
            if (outp is DDS)
            {
                DDS inp = inputType as DDS;
                //switch (formats) { }

                return outp;
            }
            else if (outp is JPG)
            {
                cType outputType = new JPG();
                bm.Save(outp.stream, System.Drawing.Imaging.ImageFormat.Jpeg);
                return outputType;
            }
            else if (outp is BMP)
            {
                cType outputType = new BMP();
                bm.Save(outp.stream, System.Drawing.Imaging.ImageFormat.Bmp);
                return outputType;
            }

            return null;
        }
示例#9
0
        private void cmdSetInCSV_Click(object sender, EventArgs e)
        {
            cType tp = (cType)cboFileType.SelectedItem;


            OpenFileDialog ofd = new OpenFileDialog();

            if (Directory.Exists(txtSetInCSV.Text))
            {
                ofd.InitialDirectory = txtSetInCSV.Text;
            }
            ofd.Filter = tp.Filter + "|All files(*.*)|*.*";
            if (ofd.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            txtSetInCSV.Text = ofd.FileName;

            if (tp.ID == "wsjt-x")
            {
                PreviewWSJT();
            }
        }
示例#10
0
        protected async Task <string> CurrentClaimByType(cType type = cType.USERNAME)
        {
            var typeStr = string.Empty;

            switch (type)
            {
            case cType.USERID:
                typeStr = "UserId";
                break;

            case cType.USERNAME:
                typeStr = "UserName";
                break;

            default:
                break;
            }
            try
            {
                var auth = await _httpContextAccessor.HttpContext.AuthenticateAsync();//获取登录用户的AuthenticateResult

                if (auth.Succeeded)
                {
                    var userCli = auth.Principal.Claims.FirstOrDefault(c => c.Type == typeStr); //在声明集合中获取ClaimTypes.NameIdentifier 的值就是用户ID
                    if (userCli == null || string.IsNullOrEmpty(userCli.Value))
                    {
                        return(null);
                    }
                    return(userCli.Value);
                }
                return(null);
            }
            catch (Exception)
            {
                return(null);
            }
        }
        // Checks if the given data contains only legal chars and if its length is in the
        // given range, according to forum policy.
        public void checkLegalContent(cType contentType, string content)
        {
            if (content == null)
                return;
            int minLen = ranges[(int)contentType].Item1;
            int maxLen = ranges[(int)contentType].Item2;
            string goodChars = ranges[(int)contentType].Item3;

            if (!isLegalContent(content, minLen, maxLen, goodChars))
            {
                string err_msg = "";
                switch (contentType)
                {
                    case (cType.USER_NAME):
                        err_msg = ForumGeneratorDefs.INVALID_USERNAME;
                        break;
                    case (cType.MEMBER_SIGNATURE):
                        err_msg = ForumGeneratorDefs.INVALID_SIGNATURE;
                        break;
                    case (cType.FORUM_NAME):
                        err_msg = ForumGeneratorDefs.INVALID_FORUM_NAME;
                        break;
                    case (cType.SUBFORUM_TITLE):
                        err_msg = ForumGeneratorDefs.INVALID_SUBFORUM_TITLE;
                        break;
                    case (cType.DISCUSSION_TITLE):
                        err_msg = ForumGeneratorDefs.INVALID_DISC_SUBJECT;
                        break;

                    default:
                        err_msg = ForumGeneratorDefs.ILL_CONTENT;
                        break;
                }

                throw new IllegalContentException(err_msg);
            }
        }
示例#12
0
 private void buttonSave_Click(object sender, EventArgs e)
 {
     outp = getSettings();
     outp = convert(this.inp);
 }
示例#13
0
 public void setFormats(cType input)
 {
     switch (input.classType)
     {
         case classTypes.DDS:
             DDS inpDDS = input as DDS;
             formats = getDDSFormats();
             comboBoxFormat.Items.Clear();
             foreach (formatTypes ft in formats)
             {
                 if (ft.compressed == inpDDS.Compressed &&
                     ft.bits == inpDDS.BitsPerPixel)
                     comboBoxFormat.Items.Add(ft.name);
             }
             break;
         case classTypes.Jpeg:
             break;
         case classTypes.Bitmap:
             break;
     }
 }
示例#14
0
 public void DDSConvert(cType input, cType output)
 {
 }
示例#15
0
 public DBField(cType type, bool primaryKey)
 {
     Type          = type;
     Primary       = primaryKey;
     AutoIncrement = false;
 }
示例#16
0
        //public Structure owner;

        public Cart(cType ccType, GameMode gMode)
        {
            this.ccType    = ccType;
            this.GameMode_ = gMode;
        }
示例#17
0
 private void buttonSave_Click(object sender, EventArgs e)
 {
     outp = getSettings();
     outp = convert(this.inp);
 }
示例#18
0
 public void DDSConvert(cType input, cType output)
 {
 }
示例#19
0
    private void Start()
    {
        pieceMove = GetComponent <PlayerMove>();

        type = GetComponent <CharacterType>().myType;
    }
示例#20
0
        // private access

        public DBField(cType type)
        {
            Type          = type;
            Primary       = false;
            AutoIncrement = false;
        }
示例#21
0
 public DBField(cType type, bool primaryKey)
 {
     Type = type;
     Primary = primaryKey;
     AutoIncrement = false;
 }
示例#22
0
 public DBField(cType type, bool primaryKey, bool autoIncrement)
 {
     Type          = type;
     Primary       = primaryKey;
     AutoIncrement = autoIncrement;
 }
示例#23
0
        public void setDetails(cType input, bool orig)
        {
            if (orig)
            {
                dataOrigType.Text   = input.classType.ToString();
                dataOrigBPP.Text    = input.BitsPerPixel.ToString();
                dataOrigWidth.Text  = input.Width.ToString();
                dataOrigHeight.Text = input.Height.ToString();
            }

            switch (input.classType)
            {
            case classTypes.DDS:
                DDS DDSInput = input as DDS;
                radioButtonDDS.Checked = true;
                // Compressed/Uncompressed
                if (DDSInput.Compressed)
                {
                    radioButtonCompressed.Checked = true;
                    radioButton32Bit.Checked      = true;
                    radioButton16Bit.Enabled      = false;
                    radioButton8Bit.Enabled       = false;
                }
                else
                {
                    radioButtonUncompressed.Checked = true;
                    radioButton16Bit.Enabled        = true;
                    radioButton8Bit.Enabled         = true;
                    switch (DDSInput.BitsPerPixel)
                    {
                    case 8:
                        radioButton8Bit.Checked = true;
                        break;

                    case 16:
                        radioButton16Bit.Checked = true;
                        break;

                    case 32:
                        radioButton32Bit.Checked = true;
                        break;
                    }
                }

                if (orig)
                {
                    dataOrigFormat.Text = DDSInput.FormatName.ToString();
                    for (int i = 1; i < DDSInput.MipMapCount; i++)
                    {
                        comboBoxMipmaps.Items.Add(i);
                    }
                    if (comboBoxMipmaps.Items.Count > 0)
                    {
                        checkBoxMipMaps.Enabled       = true;
                        checkBoxMipMaps.Checked       = true;
                        comboBoxMipmaps.SelectedIndex = comboBoxMipmaps.Items.Count - 1;
                    }
                    else
                    {
                        checkBoxMipMaps.Checked = false;
                        checkBoxMipMaps.Enabled = false;
                    }
                }

                setFormats(DDSInput);
                break;

            case classTypes.Jpeg:
                JPG JPGInput = input as JPG;
                radioButtonJpeg.Checked = true;
                break;

            case classTypes.Bitmap:
                BMP BMPInput = input as BMP;
                radioButtonBitmap.Checked = true;
                break;
            }
        }
示例#24
0
        // private access

        public DBField(cType type)
        {
            Type = type;
            Primary = false;
            AutoIncrement = false;
        }
示例#25
0
    public void PlayTurn()
    {
        Debug.Log("Play Turn");
        foreach (EnemyMovement em in pieces)
        {
            em.FindNearestTarget();
            Debug.Log(em.target.transform.position);

            float playerDistance = Vector3.Distance(em.transform.position, em.target.transform.position);
            float threshold      = 5f;
            bool  wiseTarget     = true;
            bool  backedUp       = false;

            foreach (EnemyMovement e in pieces)
            {
                if (Vector3.Distance(em.transform.position, e.transform.position) < 5)
                {
                    backedUp = true;
                }
            }

            if (playerDistance < threshold)
            {
                cType mType = em.gameObject.GetComponent <CharacterType>().myType;
                cType tType = em.target.GetComponent <CharacterType>().myType;

                if (!(mType == tType) && !backedUp)
                {
                    if (!(mType == cType.tSword && tType == cType.tSpear))
                    {
                        if (!(mType == cType.tSpear && tType == cType.tHeavy))
                        {
                            if (!(mType == cType.tHeavy && tType == cType.tSword))
                            {
                                wiseTarget = false;
                            }
                        }
                    }
                }
            }

            if ((playerDistance > threshold || !wiseTarget) && !backedUp)
            {
                EnemyMovement closestFriend   = null;
                float         closestDistance = Mathf.Infinity;

                foreach (EnemyMovement buddy in pieces)
                {
                    if (em.transform.position != buddy.transform.position)
                    {
                        float currentDistance = Vector3.Distance(em.transform.position, buddy.transform.position);

                        if (currentDistance < closestDistance)
                        {
                            closestFriend   = buddy;
                            closestDistance = currentDistance;
                        }
                    }
                }

                em.target = closestFriend.gameObject;
            }

            if (!(em.moving))
            {
                em.FindPath();
                em.BreadthFirstSeach();
                em.actualTarget.target = true;
            }
        }

        Endturn();
    }
示例#26
0
 public DBField(cType type, bool primaryKey, bool autoIncrement)
 {
     Type = type;
     Primary = primaryKey;
     AutoIncrement = autoIncrement;
 }
示例#27
0
        public void setDetails(cType input, bool orig)
        {
            if (orig)
            {
                dataOrigType.Text = input.classType.ToString();
                dataOrigBPP.Text = input.BitsPerPixel.ToString();
                dataOrigWidth.Text = input.Width.ToString();
                dataOrigHeight.Text = input.Height.ToString();
            }

            switch (input.classType)
            {
                case classTypes.DDS:
                    DDS DDSInput = input as DDS;
                    radioButtonDDS.Checked = true;
                    // Compressed/Uncompressed
                    if (DDSInput.Compressed)
                    {
                        radioButtonCompressed.Checked = true;
                        radioButton32Bit.Checked = true;
                        radioButton16Bit.Enabled = false;
                        radioButton8Bit.Enabled = false;
                    }
                    else
                    {
                        radioButtonUncompressed.Checked = true;
                        radioButton16Bit.Enabled = true;
                        radioButton8Bit.Enabled = true;
                        switch (DDSInput.BitsPerPixel)
                        {
                            case 8:
                                radioButton8Bit.Checked = true;
                                break;
                            case 16:
                                radioButton16Bit.Checked = true;
                                break;
                            case 32:
                                radioButton32Bit.Checked = true;
                                break;
                        }
                    }

                    if (orig)
                    {
                        dataOrigFormat.Text = DDSInput.FormatName.ToString();
                        for (int i = 1; i < DDSInput.MipMapCount; i++)
                            comboBoxMipmaps.Items.Add(i);
                        if (comboBoxMipmaps.Items.Count > 0)
                        {
                            checkBoxMipMaps.Enabled = true;
                            checkBoxMipMaps.Checked = true;
                            comboBoxMipmaps.SelectedIndex = comboBoxMipmaps.Items.Count - 1;
                        }
                        else
                        {
                            checkBoxMipMaps.Checked = false;
                            checkBoxMipMaps.Enabled = false;
                        }
                    }

                    setFormats(DDSInput);
                    break;
                case classTypes.Jpeg:
                    JPG JPGInput = input as JPG;
                    radioButtonJpeg.Checked = true;
                    break;
                case classTypes.Bitmap:
                    BMP BMPInput = input as BMP;
                    radioButtonBitmap.Checked = true;
                    break;
            }
        }