Exemplo n.º 1
0
 public void Reset()
 {
     ItemList.Clear();
     EnemyList.Clear();
     BlockList.Clear();
     BackgroundList.Clear();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Occurs when the tag field has been changed.
        /// </summary>
        /// <param name="e">An <see cref="EventArgs"/> that contains the event data.</param>
        protected override void OnTagFieldChanged(EventArgs e)
        {
            //Reinitialize List
            BlockList.Clear();
            foreach (ITagBlock tagBlock in TagField.BlockList)
            {
                BlockList.Add(new TagBlockModel()
                {
                    Owner = Owner, TagBlock = tagBlock
                });
            }

            //Check
            if (BlockList.Count > 0)
            {
                SelectedBlockIndex = 0;
            }
            else
            {
                SelectedBlockIndex = -1;
            }

            //Notify
            Expanded = BlockList.Count > 0;
            NotifyPropertyChanged(nameof(HasBlocks));

            //Base procedures
            base.OnTagFieldChanged(e);
        }
Exemplo n.º 3
0
        private bool ExtractInitData(string s)
        {
            string[] delim  = { "var initData = {};", "initData.globalLocale =" };
            string[] delim2 = { "initData." };
            string[] delim3 = { " = " };
            char[]   delim4 = { ' ', ';', '\n', '	'};

            string[] s1 = s.Split(delim, StringSplitOptions.None);
            if (s1.Length < 3)
            {
                return(false);
            }

            string s2 = s1[1];

            string[] datum = s2.Split(delim2, StringSplitOptions.RemoveEmptyEntries);

            string product = datum[1].Split(delim3, StringSplitOptions.None)[1];
            string meta    = datum[2].Split(delim3, StringSplitOptions.None)[1];
            string grade   = datum[3].Split(delim3, StringSplitOptions.None)[1];

            product = product.TrimEnd(delim4);
            meta    = meta.TrimEnd(delim4);
            grade   = grade.TrimEnd(delim4);

            _product = JsonConvert.DeserializeObject <Product>(product);
            _meta    = JsonConvert.DeserializeObject <Meta>(meta);
            _grades  = JsonConvert.DeserializeObject <Grade[]>(grade);

            GradeList.Clear();
            BlockList.Clear();

            Grade defaultGrade = new Grade();

            defaultGrade.gradeId = 0;
            defaultGrade.name    = "전체";
            Meta.Draw.BlockInfo defaultBlock = new Meta.Draw.BlockInfo();
            defaultBlock.blockId   = 0;
            defaultBlock.blockName = "전체";
            GradeList.Add(defaultGrade);
            BlockList.Add(defaultBlock);

            foreach (Grade item in _grades)
            {
                GradeList.Add(item);
            }
            foreach (Meta.Draw.BlockInfo item in _meta.draw.blockInfo)
            {
                BlockList.Add(item);
            }

            return(true);
        }
Exemplo n.º 4
0
    public void ResetFiledData()
    {
        StageIndex = -1;
        BlockIndex = -1;
        BlockList.Clear();
        MaxTime = 0.0f;

        WhoBattleType  = CHARACTER_TYPE.CHAR_NONE;
        MissionStatus  = MISSION_STATUS.MISSION_START;
        ifRescue       = false;
        WhoRescueIndex = -1;
        WhoRescueClass = CLASS.CLASS_NONE;
    }
Exemplo n.º 5
0
        private void DeleteAll()
        {
            //Remove
            TagField.BlockList.Clear();
            BlockList.Clear();

            //Notify Changes
            NotifyPropertyChanged(nameof(HasBlocks));

            //Set
            SelectedBlockIndex = -1;
            NotifyValueChanged();
        }
Exemplo n.º 6
0
 public override void Refresh()
 {
     CheckRunningStatus();
     ResultList.Clear();
     TargetProject.ResultList.ForEach(v => ResultList.Add(new InstrumentViewModel()
     {
         TargetObject = v, GetCurrentDataSource = () => { return(CurrentDataSource); }
     }));
     BlockList.Clear();
     TargetProject.BlockList.ForEach(v => BlockList.Add(new InstrumentViewModel()
     {
         TargetObject = v, GetCurrentDataSource = () => { return(CurrentDataSource); }
     }));
     OnPropertyChanged("FinishPercent");
     OnPropertyChanged("IsRunning");
     OnPropertyChanged("ProcessInfo");
     OnPropertyChanged("CanStart");
     OnPropertyChanged("CanPause");
     OnPropertyChanged("CanStop");
     base.Refresh();
 }
Exemplo n.º 7
0
        internal static void Update()
        {
            if (BlockList == null)
            {
                BlockList = new List <Keys>();
            }

            if (BlockListMouse == null)
            {
                BlockListMouse = new List <MouseButtons>();
            }

            PreviousKeyState = KeyState;
            KeyState         = Keyboard.GetState();
            BlockList.Clear();

            PreviousMouseState = MouseState;
            MouseState         = Mouse.GetState();
            BlockListMouse.Clear();

            if (sInputbox == null)
            {
                return;
            }

            if (AllKeysPressed(Keys.CapsLock))
            {
                sCapsLocks = !sCapsLocks;
            }


            var big = false || sCapsLocks;

            if (AllKeysDown(Keys.LeftShift) || AllKeysDown(Keys.RightShift))
            {
                big = !big;
            }

            var pressedKeys = Enum.GetValues(typeof(Keys))
                              .Cast <Keys>()
                              .Where(key => AllKeysPressed(key));

            foreach (var key in pressedKeys)
            {
                if (key == Keys.Back && sInputbox.Text.Length > 0)
                {
                    if (sInputbox.mCursorPos == 0)
                    {
                        continue;
                    }

                    sInputbox.Text = sInputbox.Text.Substring(0, sInputbox.mCursorPos - 1);//  + sInputbox.Text.Substring(sInputbox.mCursorPos + 1, sInputbox.Text.Length - 1);
                    DecreaseCursor();
                    continue;
                }

                if (key == Keys.Back)
                {
                    continue;
                }

                if (key == Keys.Left)
                {
                    DecreaseCursor();
                    continue;
                }

                if (key == Keys.Right)
                {
                    IncreaseCursor();
                    continue;
                }

                if (key == Keys.Space)
                {
                    AddToInputText(" ");
                    continue;
                }

                if (key == Keys.Enter)
                {
                    AddToInputText("\n");
                    continue;
                }

                if (key == Keys.NumPad0)
                {
                    AddToInputText("0");
                    continue;
                }

                if (key == Keys.NumPad1)
                {
                    AddToInputText("1");
                    continue;
                }

                if (key == Keys.NumPad2)
                {
                    AddToInputText("2");
                    continue;
                }

                if (key == Keys.NumPad3)
                {
                    AddToInputText("3");
                    continue;
                }

                if (key == Keys.NumPad4)
                {
                    AddToInputText("4");
                    continue;
                }

                if (key == Keys.NumPad5)
                {
                    AddToInputText("5");
                    continue;
                }

                if (key == Keys.NumPad6)
                {
                    AddToInputText("6");
                    continue;
                }

                if (key == Keys.NumPad7)
                {
                    AddToInputText("7");
                    continue;
                }

                if (key == Keys.NumPad8)
                {
                    AddToInputText("8");
                    continue;
                }

                if (key == Keys.NumPad9)
                {
                    AddToInputText("9");
                    continue;
                }

                if (key == Keys.D0)
                {
                    AddToInputText(big ? "=" : "0");
                    continue;
                }

                if (key == Keys.D1)
                {
                    AddToInputText(big ? "!" : "1");
                    continue;
                }

                if (key == Keys.D2)
                {
                    AddToInputText(big ? "\'" : "2"); // Only single quotes, otherwise it is going to crash
                    continue;
                }

                if (key == Keys.D3)
                {
                    AddToInputText("3");
                    continue;
                }

                if (key == Keys.D4)
                {
                    AddToInputText(big ? "$" : "4");
                    continue;
                }

                if (key == Keys.D5)
                {
                    AddToInputText(big ? "%" : "5");
                    continue;
                }

                if (key == Keys.D6)
                {
                    AddToInputText(big ? "&" : "6");
                    continue;
                }

                if (key == Keys.D7)
                {
                    AddToInputText(big ? "/" : "7");
                    continue;
                }

                if (key == Keys.D8)
                {
                    AddToInputText(big ? "(" : "8");
                    continue;
                }

                if (key == Keys.D9)
                {
                    AddToInputText(big ? ")" : "9");
                    continue;
                }

                if (key == Keys.OemMinus)
                {
                    AddToInputText("-");
                    continue;
                }

                if (key == Keys.OemOpenBrackets)
                {
                    AddToInputText("?");
                    continue;
                }

                if (key == Keys.OemComma)
                {
                    AddToInputText(",");
                    continue;
                }

                if (key == Keys.OemQuestion)
                {
                    AddToInputText("ß");
                    continue;
                }

                if (key == Keys.OemMinus)
                {
                    AddToInputText("-");
                    continue;
                }

                if (key == Keys.OemPeriod)
                {
                    AddToInputText(big ? ":" : ".");
                    continue;
                }


                if (key < Keys.A || key > Keys.Z)
                {
                    continue;
                }

                var keyValue = key.ToString();
                if (!big)
                {
                    keyValue = keyValue.ToLower();
                }
                // sInputbox.Text = sInputbox.Text + keyValue;
                AddToInputText(keyValue);
            }
        }
Exemplo n.º 8
0
		public virtual void TestAddToEnd()
		{
			BlockList<int> list = new BlockList<int>(4);
			int cnt = BlockList<int>.BLOCK_SIZE * 3;
			for (int i = 0; i < cnt; i++)
			{
				list.AddItem(Sharpen.Extensions.ValueOf(42 + i));
			}
			NUnit.Framework.Assert.AreEqual(cnt, list.Count);
			for (int i_1 = 0; i_1 < cnt; i_1++)
			{
				NUnit.Framework.Assert.AreEqual(Sharpen.Extensions.ValueOf(42 + i_1), list[i_1]);
			}
			list.Clear();
			NUnit.Framework.Assert.AreEqual(0, list.Count);
			NUnit.Framework.Assert.IsTrue(list.IsEmpty());
			for (int i_2 = 0; i_2 < cnt; i_2++)
			{
				list.Add(i_2, Sharpen.Extensions.ValueOf(42 + i_2));
			}
			NUnit.Framework.Assert.AreEqual(cnt, list.Count);
			for (int i_3 = 0; i_3 < cnt; i_3++)
			{
				NUnit.Framework.Assert.AreEqual(Sharpen.Extensions.ValueOf(42 + i_3), list[i_3]);
			}
		}