Exemplo n.º 1
0
        public virtual TData Add(TData buff)
        {
            if (!SelfBaseUnit.IsLive)
            {
                return(null);
            }
            TData     newBuff   = null;
            BuffGroup buffGroup = null;

            //有buff组的buff叠加
            if (!string.IsNullOrEmpty(buff.BuffGroupID))
            {
                if (!Data.ContainsKey(buff.BuffGroupID))
                {
                    var tempGroup = new BuffGroup();
                    Data.Add(buff.BuffGroupID, tempGroup);
                    ListData.Add(tempGroup);
                    //没有隐藏的buff加入显示队列
                    if (!buff.IsHide)
                    {
                        ShowData.Add(tempGroup);
                    }
                    //非永久buff加入 update队列
                    if (buff.IsHaveMaxTime)
                    {
                        UpdateData.Add(tempGroup);
                    }
                }
                buffGroup = Data[buff.BuffGroupID];
                newBuff   = buffGroup.Add(buff, SelfBaseUnit);
            }
            //没有buff组的buff合并
            else
            {
                if (!Data.ContainsKey(buff.TDID))
                {
                    var tempGroup = new BuffGroup();
                    Data.Add(buff.TDID, tempGroup);
                    ListData.Add(tempGroup);
                    //没有隐藏的buff加入显示队列
                    if (!buff.IsHide)
                    {
                        ShowData.Add(tempGroup);
                    }
                    //非永久buff加入 update队列
                    if (buff.IsHaveMaxTime)
                    {
                        UpdateData.Add(tempGroup);
                    }
                }
                buffGroup = Data[buff.TDID];
                newBuff   = buffGroup.Merge(buff, SelfBaseUnit);
            }
            if (BaseGlobal.IsUnReadData)
            {
                Callback_OnBuffChange?.Invoke();
            }
            return(newBuff);
        }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 private void OnLabelCmd()
 {
     LblTxt += "bbb";
     ListData.Add(new SampleModel()
     {
         Name = "no name", Address = "六甲山のどっか", Age = 35, Birthday = new DateTime(2001, 1, 12), Job = "プログラマー"
     });
     NotifyPropertyChanged("ShowListData");
 }
Exemplo n.º 3
0
        public void DoAddItem(object itemText)
        {
            var newItem = itemText as string;

            if (string.IsNullOrEmpty(newItem))
            {
                newItem = "Item" + ListData.Count;
            }
            ListData.Add(newItem);
        }
        private void AddMesage(string mesage, bool myText)
        {
            ItemChatViewModel item = new ItemChatViewModel();

            item.TextChat = mesage;
            item.MyChat   = myText;

            Device.BeginInvokeOnMainThread(() => {
                ListData.Add(item);
            });
        }
Exemplo n.º 5
0
 void AddItems()
 {
     for (int i = 0; i < 4; i++)
     {
         ListData.Add(new DataTest
         {
             BookmarkShow = false,
             Detail       = "TestTestTestTestTestTest",
             Title        = "Hello" + i,
         });
     }
 }
Exemplo n.º 6
0
        public virtual TData Add(TData buff, BaseUnit caster = null, float step = 0.0f, TDBaseSkillData skill = null)
        {
            if (!SelfBaseUnit.IsLive)
            {
                return(null);
            }
            TData     newBuff   = null;
            BuffGroup buffGroup = null;

            //有buff组的buff叠加
            if (!string.IsNullOrEmpty(buff.BuffGroupID))
            {
                if (!Data.ContainsKey(buff.BuffGroupID))
                {
                    var tempGroup = new BuffGroup();
                    Data.Add(buff.BuffGroupID, tempGroup);
                    ListData.Add(tempGroup);

                    //非永久buff加入 update队列
                    if (buff.MaxTime > 0)
                    {
                        UpdateDataList.Add(tempGroup);
                    }
                }
                buffGroup = Data[buff.BuffGroupID];
                newBuff   = buffGroup.Add(buff, SelfBaseUnit, caster, skill);
            }
            //没有buff组的buff合并
            else
            {
                if (!Data.ContainsKey(buff.TDID))
                {
                    var tempGroup = new BuffGroup();
                    Data.Add(buff.TDID, tempGroup);
                    ListData.Add(tempGroup);

                    //非永久buff加入 update队列
                    if (buff.MaxTime > 0)
                    {
                        UpdateDataList.Add(tempGroup);
                    }
                }
                buffGroup = Data[buff.TDID];
                newBuff   = buffGroup.Merge(buff, SelfBaseUnit, caster, skill);
            }
            Callback_OnBuffChange?.Invoke();
            if (newBuff != null)
            {
                newBuff.SetStep(step);
            }
            return(newBuff);
        }
Exemplo n.º 7
0
        async void SubmitExecute(object parameter)
        {
            if (string.IsNullOrEmpty(NewMessage))
            {
                return;
            }

            var data = await _ds.PostUserMessage(NewMessage, UserId);

            if (data != null)
            {
                ListData.Add(data);
                TipText = NewMessage = string.Empty;
            }
        }
Exemplo n.º 8
0
        public void registerRegistrovatSe()
        {
            string jmeno  = RegisterUsername;
            string heslo  = RegisterPassword;
            string heslo2 = RegisterPasswordAgain;

            // Kontrola hesel
            if (heslo != heslo2)
            {
                System.Windows.MessageBox.Show("Vaše hesla nejsou stejná.");
                return;
            }
            if (heslo.Length < 4)
            {
                System.Windows.MessageBox.Show("Vaše heslo je kratší než 4 charaktery.");
                return;
            }
            if (jmeno == "")
            {
                System.Windows.MessageBox.Show("Vaše přezdívka je prázdná.");
                return;
            }

            foreach (Login a in ListData)
            {
                // Kontrola zda tato přezdívka již neexistuje
                if (a.username == jmeno)
                {
                    System.Windows.MessageBox.Show("Uživatel s touto přezdívkou již existuje.");
                    return;
                }
            }
            Login login = new Login {
                username = jmeno, password = heslo
            };

            ListData.Add(login);
            System.Windows.MessageBox.Show("Registrace úspěšná.");
            LoginPageVisibility    = "Visible";
            RegisterPageVisibility = "Collapsed";
            AukroPageVisibility    = "Collapsed";
            RegisterUsername       = "";
            RegisterPassword       = "";
            RegisterPasswordAgain  = "";
        }
Exemplo n.º 9
0
        public void LoadMoreItems(MyData currentItem)
        {
            int itemIndex = ListData.IndexOf(currentItem);

            _offset = ListData.Count;

            if (ListData.Count - 3 == itemIndex)
            {
                string        sql  = $"SELECT * FROM MyData LIMIT 20 OFFSET {_offset}";
                List <MyData> data = conn.Query <MyData>(sql);
                foreach (MyData item in data)
                {
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        ListData.Add(item);
                    });
                }
            }
        }
Exemplo n.º 10
0
        // Konstruktor
        public MainViewModel()
        {
            loginPrihlasit   = new Command(loginPrihlasitSe);
            loginRegistrovat = new Command(loginRegistrovatSe);
            Login login = new Login {
                username = "******", password = "******"
            };

            ListData.Add(login);
            LoginPageVisibility    = "Visible";
            RegisterPageVisibility = "Collapsed";
            AukroPageVisibility    = "Collapsed";
            registerRegistrovat    = new Command(registerRegistrovatSe);
            registerZpet           = new Command(registerZpetCommand);
            AukroKoupit            = new Command(AukroKoupitCommand);
            AukroProdat            = new Command(AukroProdatCommand);
            AukroOdhlasit          = new Command(AukroOdhlasitCommand);
            // AukroDataString = new List<string>();  // Pro zobrazování do listview
            aukroData = new ObservableCollection <string>();
        }
Exemplo n.º 11
0
 public KJson Add(object value)
 {
     isList = true;
     ListData.Add(value);
     return(this);
 }
Exemplo n.º 12
0
 private void addListData()
 {
     ListData.Add("add");
 }