예제 #1
0
 private void EvtStat(EnumStat stat)
 {
     try
     {
         if (stat == EnumStat.StartPos)
         {
             oneScanTime    = DateTime.Now;
             IsShowScanTime = true;
             this.Invoke(new Action(delegate()
             {
                 chkStartPos.Checked     = true;
                 chkStopPos.Checked      = false;
                 chkSwathStatPos.Checked = false;
                 chkSwathEndPos.Checked  = false;
             }));
         }
         else if (stat == EnumStat.HomePos)
         {
             this.Invoke(new Action(delegate()
             {
                 chkStartPos.Checked     = false;
                 chkStopPos.Checked      = true;
                 chkSwathStatPos.Checked = false;
                 chkSwathEndPos.Checked  = false;
             }));
         }
         else if (stat == EnumStat.SwathStart)
         {
             this.Invoke(new Action(delegate()
             {
                 chkStartPos.Checked     = false;
                 chkStopPos.Checked      = false;
                 chkSwathStatPos.Checked = true;
                 chkSwathEndPos.Checked  = false;
             }));
         }
         else if (stat == EnumStat.SwathEnd)
         {
             this.Invoke(new Action(delegate()
             {
                 chkStartPos.Checked     = false;
                 chkStopPos.Checked      = false;
                 chkSwathStatPos.Checked = false;
                 chkSwathEndPos.Checked  = true;
             }));
         }
         else if (stat == EnumStat.ScanFinish)
         {
             IsShowScanTime = false;
             SCAN_TOTAL_CNT++;
         }
     }
     catch (Exception ex)
     {
         LogHelper.AppLoger.Error(ex);
     }
 }
예제 #2
0
 private void ThrowStat(EnumStat stat)
 {
     if (UpdateStat != null)
     {
         foreach (UpdateMoveStatHandler t in UpdateStat.GetInvocationList())
         {
             t.BeginInvoke(stat, null, null);
         }
     }
 }
예제 #3
0
 private void IAutoCtl_UpdateStat(EnumStat stat)
 {
     EvtStat(stat);
 }
예제 #4
0
        public Character(Stream characterSaveFileStream)
        {
            if(characterSaveFileStream == null) throw new ArgumentNullException("characterSaveFileStream");
            if(!characterSaveFileStream.CanRead) throw new ArgumentException("characterSaveFileStream cannot be read.", "characterSaveFileStream");
            if(characterSaveFileStream.Length < 1) throw new ArgumentException("characterSaveFileStream does not contain any data", "characterSaveFileStream");

            using(var ms = new MemoryStream())
            {
                characterSaveFileStream.CopyTo(ms);
                _buffer = ms.ToArray();
                _bufferBackup = ms.ToArray();
            }

            #region Character Stats - Base

            Name = new ASCIIStat(_buffer, 256, 8);
            Name.ValueChanged += OnStatValueChanged;

            Money = new UShortStat(_buffer, 620);
            Money.ValueChanged += OnStatValueChanged;

            Class = new EnumStat<CharacterClass>(_buffer, 336);
            Class.ValueChanged += OnStatValueChanged;

            Level = new UShortStat(_buffer, 324);
            Level.ValueChanged += OnStatValueChanged;

            LevelBase = new UShortStat(_buffer, 326);
            LevelBase.ValueChanged += OnStatValueChanged;

            Hp = new UShortStat(_buffer, 328);
            Hp.ValueChanged += OnStatValueChanged;

            HpBase = new UShortStat(_buffer, 332);
            HpBase.ValueChanged += OnStatValueChanged;

            Mp = new UShortStat(_buffer, 330);
            Mp.ValueChanged += OnStatValueChanged;

            MpBase = new UShortStat(_buffer, 334);
            MpBase.ValueChanged += OnStatValueChanged;

            #endregion

            #region Character Stats - Abilities

            Str = new UShortStat(_buffer, 288);
            Str.ValueChanged += OnStatValueChanged;

            StrBase = new UShortStat(_buffer, 640);
            StrBase.ValueChanged += OnStatValueChanged;

            Int = new UShortStat(_buffer, 290);
            Int.ValueChanged += OnStatValueChanged;

            IntBase = new UShortStat(_buffer, 642);
            IntBase.ValueChanged += OnStatValueChanged;

            Wil = new UShortStat(_buffer, 292);
            Wil.ValueChanged += OnStatValueChanged;

            WilBase = new UShortStat(_buffer, 644);
            WilBase.ValueChanged += OnStatValueChanged;

            Agi = new UShortStat(_buffer, 294);
            Agi.ValueChanged += OnStatValueChanged;

            AgiBase = new UShortStat(_buffer, 646);
            AgiBase.ValueChanged += OnStatValueChanged;

            Con = new UShortStat(_buffer, 296);
            Con.ValueChanged += OnStatValueChanged;

            ConBase = new UShortStat(_buffer, 648);
            ConBase.ValueChanged += OnStatValueChanged;

            Pow = new UShortStat(_buffer, 298);
            Pow.ValueChanged += OnStatValueChanged;

            PowBase = new UShortStat(_buffer, 650);
            PowBase.ValueChanged += OnStatValueChanged;

            Lck = new UShortStat(_buffer, 300);
            Lck.ValueChanged += OnStatValueChanged;

            LckBase = new UShortStat(_buffer, 652);
            LckBase.ValueChanged += OnStatValueChanged;

            At = new UShortStat(_buffer, 304);
            At.ValueChanged += OnStatValueChanged;

            AtBase = new UShortStat(_buffer, 656);
            AtBase.ValueChanged += OnStatValueChanged;

            Df = new UShortStat(_buffer, 306);
            Df.ValueChanged += OnStatValueChanged;

            DfBase = new UShortStat(_buffer, 658);
            DfBase.ValueChanged += OnStatValueChanged;

            Mat = new UShortStat(_buffer, 312);
            Mat.ValueChanged += OnStatValueChanged;

            MatBase = new UShortStat(_buffer, 664);
            MatBase.ValueChanged += OnStatValueChanged;

            Mdf = new UShortStat(_buffer, 314);
            Mdf.ValueChanged += OnStatValueChanged;

            MdfBase = new UShortStat(_buffer, 666);
            MdfBase.ValueChanged += OnStatValueChanged;

            #endregion
        }