public string GetProperty(string propertyName) { string r = null; switch (propertyName) { case "Name": r = Name; break; case "Lv": r = Lv.ToString(); break; case "Form": r = GameString.Current.Pokemon(number, form); break; case "State": r = GameString.Current.PokemonState(State); break; case "Owner.Name": r = Owner.Name; break; } return(r); }
public void LoadStatus(SaveData LoadData) { Name = new Name(LoadData.Name); Lv = new Lv(LoadData.Lv); Hp = new Hp(LoadData.MaxHp, LoadData.CurrentHp); Mp = new Mp(LoadData.MaxMp, LoadData.CurrentMp); Str = new Str(LoadData.Str); Vit = new Vit(LoadData.Vit); Dex = new Dex(LoadData.Dex); Int = new Int(LoadData.Int); Exp = new Exp(LoadData.NextExp, LoadData.CurrentExp); MoveSpeed = new MoveSpeed(3, 1); Direction = new Direction(Animator); ChargeSkill = new SwordChargeAtack(); NormalAtack = new SwordNomalAtack(); Skill = NormalAtack; Charge = GameObject.transform.Find("tame").GetComponent <Charge>(); Weapon = (GameObject)Resources.Load("prefab/Weapon/Sword"); Equip = new Equip(); Equip.Weapon(LoadData.EquipWeapon); Equip.Head(LoadData.EquipHead); Equip.Body(LoadData.EquipBody); Equip.Hand(LoadData.EquipHand); Equip.Foot(LoadData.EquipFoot); Equip.Accessory(LoadData.EquipAccessory); }
public LvDataView(Lv p_owner, INotifyList p_data) { _owner = p_owner; _data = p_data; _data.CollectionChanged += OnCollectionChanged; Refresh(); }
public override int GetHashCode() { int hash = 1; if (Guideid != 0) { hash ^= Guideid.GetHashCode(); } if (Coin != 0) { hash ^= Coin.GetHashCode(); } if (Lv != 0) { hash ^= Lv.GetHashCode(); } if (Exp != 0) { hash ^= Exp.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public LvItem(Lv p_lv, object p_data, int p_index) { _owner = p_lv; Data = p_data; _index = p_index; if (_owner.IsVir) { _cacheUI = new Dictionary <string, object>(StringComparer.OrdinalIgnoreCase); } }
public override Dictionary <string, object> SaveToDict() { var dict = new Dictionary <string, object>(); dict.Add(GDMConstants.SchemaKey, "ASkill"); dict.Merge(true, Lv.ToGDEDict(LvKey)); dict.Merge(true, Id.ToGDEDict(IdKey)); return(dict); }
public void LvUp() { Lv.LvUp(); Hp.LvUp(10); Mp.LvUp(5); Str.LvUp(5); Vit.LvUp(5); Dex.LvUp(3); Int.LvUp(1); DataManager.Save(); }
public ColHeader(Lv p_owner) { Lv = p_owner; Cols cols = p_owner.Cols; cols.Update += (s, e) => InvalidateMeasure(); foreach (var col in cols) { Children.Add(new ColHeaderCell(col, this)); } }
// 初始化战斗内容 protected virtual void InitBattle() { AddResource(1, "Money", 0); AddResource(2, "Money", 0); AddResource(1, "Suppliment", 0); AddResource(2, "Suppliment", 0); AddResource(1, "SupplimentLimit", 30); AddResource(2, "SupplimentLimit", 30); Lv.Init(this); }
private void Write(string text, [CallerMemberName] string typeIdentifier = "") { ConsoleItems.Add(new ConsoleItemViewModel { Text = text, ConsoleItemType = (ConsoleItemType)Enum.Parse(typeof(ConsoleItemType), typeIdentifier.Replace("Write", string.Empty)) }); if (ConsoleItems.Count > 50) { ConsoleItems.Remove(ConsoleItems.First()); } Lv.ScrollIntoView(ConsoleItems.Last()); }
public GroupRow(Lv p_owner, IList p_group) { DefaultStyleKey = typeof(GroupRow); Data = p_group; if (p_owner.GroupTemplate != null) { Content = p_owner.GroupTemplate.LoadContent(); DataContext = p_group; } else { Content = new TextBlock { Text = p_group.ToString(), VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(20, 0, 20, 0) }; } }
public override int GetHashCode() { int hash = 1; if (Win != false) { hash ^= Win.GetHashCode(); } if (Fbid != 0) { hash ^= Fbid.GetHashCode(); } if (Resthp != 0) { hash ^= Resthp.GetHashCode(); } if (Costtime != 0) { hash ^= Costtime.GetHashCode(); } if (Coin != 0) { hash ^= Coin.GetHashCode(); } if (Lv != 0) { hash ^= Lv.GetHashCode(); } if (Exp != 0) { hash ^= Exp.GetHashCode(); } if (Crystal != 0) { hash ^= Crystal.GetHashCode(); } if (Fuben != 0) { hash ^= Fuben.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public GroupHeader(Lv p_owner) { Lv = p_owner; Background = Res.WhiteBrush; foreach (var grp in p_owner.GroupRows) { Children.Add(new GroupHeaderCell(grp, this)); } _border = new Border { BorderThickness = new Thickness(0, 0, 0, 1), BorderBrush = Res.浅灰边框, IsHitTestVisible = false }; Children.Add(_border); if (!Kit.IsPhoneUI) { PointerWheelChanged += OnPointerWheelChanged; } }
public void SetValue() { WWWForm form = new WWWForm(); form.AddField("order", "gameMoneysetValue"); form.AddField("order", "realmoneysetValue"); form.AddField("order", "expsetValue"); form.AddField("order", "lvValue"); form.AddField("order", "openslotValue"); //form.AddField("order", "closeslotValue"); form.AddField("gamemoney", Gamemoney); form.AddField("realmoney", Realmoney); form.AddField("exp", Exp.ToString()); form.AddField("lv", Lv.ToString()); form.AddField("openslot", Openslot.ToString()); StartCoroutine(Post(form)); }
public override int GetHashCode() { int hash = 1; if (Id != 0L) { hash ^= Id.GetHashCode(); } if (Name.Length != 0) { hash ^= Name.GetHashCode(); } if (Servernumber != 0) { hash ^= Servernumber.GetHashCode(); } if (Shape != 0) { hash ^= Shape.GetHashCode(); } if (Lv != 0) { hash ^= Lv.GetHashCode(); } if (Exp != 0L) { hash ^= Exp.GetHashCode(); } if (Gold != 0L) { hash ^= Gold.GetHashCode(); } if (Gem != 0L) { hash ^= Gem.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
/// <summary> /// 为Lv增加默认上下文菜单 /// </summary> /// <param name="p_lv"></param> public static void AddMenu(Lv p_lv) { Throw.IfNull(p_lv); p_lv.ItemDoubleClick += (s, e) => OpenFormWin(new WfFormInfo(((Row)e).Long("id"))); Menu menu = new Menu(); var mi = new Mi { ID = "查看表单", Icon = Icons.全选 }; mi.Click += (s, e) => OpenFormWin(new WfFormInfo(e.Row.Long("id"))); menu.Items.Add(mi); mi = new Mi { ID = "日志", Icon = Icons.审核 }; mi.Click += (s, e) => ShowLog(e.Row.Long("id")); menu.Items.Add(mi); Ex.SetMenu(p_lv, menu); }
RedSlime() { Name = new Name("レッドスライム"); Lv = new Lv(5); Hp = new Hp(20, 20); Mp = new Mp(0, 0); Str = new Str(20); Vit = new Vit(20); Exp = 10; Gold = 10; DropItem = 0; MoveSpeed = 1; MoveStatus = 0; AtackWaitTime = 1f; DeathCheck = false; AtackOn = false; MoveOn = false; MoveOnX = 0; MoveOnY = 0; }
public LvPanel(Lv p_owner) { _owner = p_owner; Background = Res.TransparentBrush; // 为高效 DefineCreateRowFunc(); // 真实行时,初次生成所有行 if (!_owner.IsVir) { LoaRealRows(); } _owner.Scroll.ViewChanged += OnScrollViewChanged; SizeChanged += OnSizeChanged; if (Kit.OS == TargetSystem.Windows) { // 屏蔽鼠标滚轮引起的抖动 PointerWheelChanged += OnPointerWheelChanged; KeyDown += OnKeyDown; } }
public ListDlg(CList p_owner) { InitializeComponent(); Title = "选择"; _owner = p_owner; Lv lv = _owner.Lv; Content = lv; if (lv.SelectionMode == SelectionMode.Multiple) { Mi mi = new Mi { ID = "确定", Icon = Icons.保存 }; mi.Click += OnMultipleOK; Menu menu = new Menu(); menu.Items.Add(mi); Menu = menu; } else { lv.ItemClick += OnSingleClick; } // 拆分填充列 if (!string.IsNullOrEmpty(_owner.SrcID) && !string.IsNullOrEmpty(_owner.TgtID)) { _srcIDs = _owner.SrcID.Split(new string[] { "#" }, StringSplitOptions.RemoveEmptyEntries); _tgtIDs = _owner.TgtID.Split(new string[] { "#" }, StringSplitOptions.RemoveEmptyEntries); if (_srcIDs.Length != _tgtIDs.Length) { _srcIDs = null; _tgtIDs = null; Kit.Error("数据填充:源列表、目标列表列个数不一致!"); } } }
public void NewGame(string name) { Name = new Name(name); Lv = new Lv(1); Hp = new Hp(50, 50); Mp = new Mp(10, 10); Str = new Str(1); Vit = new Vit(1); Dex = new Dex(1); Int = new Int(1); Exp = new Exp(100, 0); MoveSpeed = new MoveSpeed(3, 1); Equip = new Equip(); Direction = new Direction(Animator); Weapon = (GameObject)Resources.Load("prefab/Weapon/Sword"); ChargeSkill = new SwordChargeAtack(); NormalAtack = new SwordNomalAtack(); Skill = NormalAtack; Charge = GameObject.transform.Find("tame").GetComponent <Charge>(); }
internal void SetOwner(Lv p_owner) { _owner = p_owner; }
public LvRow(Lv p_owner) { _owner = p_owner; }
public TileFormRow(Lv p_owner) : base(p_owner) { LoadCols(); AttachEvent(); }
public TileRow(Lv p_owner, DataTemplate p_temp) : base(p_owner) { LoadContent(p_temp.LoadContent() as UIElement); AttachEvent(); }
public TileRow(Lv p_owner, IRowView p_rowView, LvItem p_item) : base(p_owner) { LoadContent(p_rowView.Create(p_item)); AttachEvent(); }
// 检查结束条件,返回 winner player public virtual int CheckWinner() { return(Lv.CheckWinner(this)); }
public ListPanel(Lv p_owner) : base(p_owner) { }
public async void ShowDlg() { Lv lv = _owner.Lv; if (lv.Data != null && !_owner.RefreshData) { // 已设置数据源 } else if (await _owner.OnLoadData()) { // 外部自定义数据源 } else if (!string.IsNullOrEmpty(_owner.Option)) { // 基础选项 lv.Data = AtModel.Query($"select name from OmOption where Category=\"{_owner.Option}\""); } else if (!string.IsNullOrEmpty(_owner.Sql)) { // Sql查询数据 lv.Data = await GetDataBySql(_owner.Sql); } else if (!string.IsNullOrEmpty(_owner.SqlKey)) { // Sql键值查询 lv.Data = await GetDataByKey(_owner.SqlKey, _owner.SqlKeyFilter); } else if (!string.IsNullOrEmpty(_owner.Enum)) { // 枚举数据 Type type = Type.GetType(_owner.Enum, true, true); lv.Data = CreateEnumData(type); } else if (((Type)_owner.ValBinding.ConverterParameter).IsEnum) { // 枚举类型 lv.Data = CreateEnumData((Type)_owner.ValBinding.ConverterParameter); } else if (_owner.Items.Count > 0) { // xaml中定义的对象列表 lv.Data = _owner.Items; } if (lv.View == null) { lv.ShowItemBorder = false; lv.View = (lv.Data is Table) ? Application.Current.Resources["CListRowView"] : Application.Current.Resources["CListObjView"]; } // 不向下层对话框传递Press事件 AllowRelayPress = false; // phone模式先最大化 if (Kit.IsPhoneUI) { ClearValue(HideTitleBarProperty); ClearValue(PhonePlacementProperty); ClearValue(HeightProperty); } Show(); // phone模式选项内容不足半屏时在下部显示 if (Kit.IsPhoneUI && DesiredSize.Height * 2 < SysVisual.ViewHeight) { //HideTitleBar = true; Top = SysVisual.ViewHeight - DesiredSize.Height; // uno中不可设置为固定高度! Height = double.NaN; } }
public TilePanel(Lv p_owner) : base(p_owner) { }
public void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { Hpl = Convert.ToDouble(textBox1.Text.Replace('.', ',')); H1 = Convert.ToDouble(textBox2.Text.Replace('.', ',')); h0 = Convert.ToDouble(textBox4.Text.Replace('.', ',')); d0 = Convert.ToDouble(textBox3.Text.Replace('.', ',')); b = Convert.ToDouble(textBox8.Text.Replace('.', ',')); m1 = Convert.ToDouble(textBox7.Text.Replace('.', ',')); m2 = Convert.ToDouble(textBox6.Text.Replace('.', ',')); Kt = Convert.ToDouble(textBox5.Text.Replace('.', ',')); Kv = Convert.ToDouble(textBox41.Text.Replace('.', ',')); E = Convert.ToDouble(textBox9.Text.Replace('.', ',')); delta_v = Convert.ToDouble(textBox39.Text.Replace('.', ',')); delta_n = Convert.ToDouble(textBox40.Text.Replace('.', ',')); } catch { MessageBox.Show("Введите корректные данные"); } L = (E * (H1 - h0) + d0) * m1 + b + m2 * Hpl; H = H1 - h0; delta_sr = (delta_n + delta_v) / 2; Bplv = b + delta_sr * (Kt / Kv - 1); //Lv = (E * (H1 - h0) + d0) * m1 + b + m2 * Hpl; Lv = (E * H + d0) * m1 + Bplv + Hpl * m2; h1 = Lv / m2 - Math.Sqrt(Math.Pow(Lv, 2) / Math.Pow(m2, 2) - Math.Pow(H1 - h0, 2)) + h0; qt = (Kt * (Math.Pow(H1, 2) - Math.Pow(h1, 2))) / (2 * (Lv - m2 * h1)); x1 = (E * H + d0) * m1; x2 = (E * H + d0) * m1 + Bplv; x6 = Lv - m2 * h1; x3 = x2 + (x6 - x2) / 4; x4 = x3 + (x6 - x2) / 4; x5 = x4 + (x6 - x2) / 4; r1 = Math.Round((2 * qt * x1) / Kt, 2); r2 = Math.Round((2 * qt * x2) / Kt, 2); r3 = Math.Round((2 * qt * x3) / Kt, 2); r4 = Math.Round((2 * qt * x4) / Kt, 2); r5 = Math.Round((2 * qt * x5) / Kt, 2); r6 = Math.Round((2 * qt * x6) / Kt, 2); yq1 = Math.Pow(H1, 2) - (2 * qt / Kt) * x1; yq2 = Math.Pow(H1, 2) - (2 * qt / Kt) * x2; yq3 = Math.Pow(H1, 2) - (2 * qt / Kt) * x3; yq4 = Math.Pow(H1, 2) - (2 * qt / Kt) * x4; yq5 = Math.Pow(H1, 2) - (2 * qt / Kt) * x5; yq6 = Math.Pow(H1, 2) - (2 * qt / Kt) * x6; x1 = Math.Round(x1, 2); x2 = Math.Round(x2, 2); x3 = Math.Round(x3, 2); x4 = Math.Round(x4, 2); x5 = Math.Round(x5, 2); x6 = Math.Round(x6, 2); y1 = Math.Round(Math.Sqrt(yq1), 2); y2 = Math.Round(Math.Sqrt(yq2), 2); y3 = Math.Round(Math.Sqrt(yq3), 2); y4 = Math.Round(Math.Sqrt(yq4), 2); y5 = Math.Round(Math.Sqrt(yq5), 2); y6 = Math.Round(Math.Sqrt(yq6), 2); yq1 = Math.Round(yq1, 2); yq2 = Math.Round(yq2, 2); yq3 = Math.Round(yq3, 2); yq4 = Math.Round(yq4, 2); yq5 = Math.Round(yq5, 2); yq6 = Math.Round(yq6, 2); h1 = Math.Round(h1, 2); Lv = Math.Round(Lv, 2); qt = Math.Round(qt, 5); delta_sr = Math.Round(delta_sr, 2); textBox34.Text = h1.ToString(); textBox35.Text = Lv.ToString(); textBox36.Text = qt.ToString(); textBox42.Text = delta_sr.ToString(); textBox10.Text = x1.ToString(); textBox11.Text = x2.ToString(); textBox12.Text = x3.ToString(); textBox13.Text = x4.ToString(); textBox14.Text = x5.ToString(); textBox15.Text = x6.ToString(); textBox21.Text = r1.ToString(); textBox20.Text = r2.ToString(); textBox19.Text = r3.ToString(); textBox18.Text = r4.ToString(); textBox17.Text = r5.ToString(); textBox16.Text = r6.ToString(); textBox27.Text = yq1.ToString(); textBox26.Text = yq2.ToString(); textBox25.Text = yq3.ToString(); textBox24.Text = yq4.ToString(); textBox23.Text = yq5.ToString(); textBox22.Text = yq6.ToString(); textBox33.Text = y1.ToString(); textBox32.Text = y2.ToString(); textBox31.Text = y3.ToString(); textBox30.Text = y4.ToString(); textBox29.Text = y5.ToString(); textBox28.Text = y6.ToString(); linkLabel1.Enabled = true; linkLabel3.Enabled = true; linkLabel5.Enabled = true; linkLabel4.Enabled = true; linkLabel6.Enabled = true; }