public object Clone() { SItem i = new SItem(mName, mSockel, mWeaponType); i.Bonus.AddRange(mBonus); return(i); }
private void UpdateImages() { string[] imgNames = new string[] { "Armreif2", "Armreif1", "Ring2", "Ring1", "Reittier", "Amulett", "Mantel", "Schild", "Waffe", "Schuhe", "Handschuh", "Hose", "Rüstung", "Helm" }; for (int i = 0; i < imgNames.Length; i++) { PictureBox box = this.panelStatus.Controls["img" + imgNames[i]] as PictureBox; if (box == null) { continue; } SItem item = mStats.GetItemFromName(imgNames[i]).Clone() as SItem; if (item.Equals(SItem.Empty)) { continue; } box.Image = Bitmap.FromStream(mAssembly.GetManifestResourceStream("Ssc.Resources.EQ_" + imgNames[i] + ".png")); } }
public bool Equals(SItem other) { if (other == null || this == null) { return(false); } if (other.Bonus.Count != this.Bonus.Count) { return(false); } if (other.Name != this.Name) { return(false); } if (other.Sockel != this.Sockel) { return(false); } if (other.WeaponType != this.WeaponType) { return(false); } return(true); }
public frmItemBonus( SItem Item, string ItemType ) { InitializeComponent(); this.Text += ItemType; if( Item.Name != string.Empty ) this.Text += " [" + Item.Name + "]"; mComboValues = Enum.GetNames( typeof( EItemBonus ) ); numSockel.Value = Item.Sockel; txtName.Text = Item.Name; for( int i = 0; i < Item.Bonus.Count; i++ ) { AddControlRow(); ( this.Controls[ "cb" + i ] as ComboBox ).SelectedIndex = (int)Item.Bonus[ i ].Type; ( this.Controls[ "num" + i ] as NumericUpDown ).Value = Item.Bonus[ i ].Value; } mBonusCount = Item.Bonus.Count; }
public frmItemBonus(SItem Item, string ItemType) { InitializeComponent(); this.Text += ItemType; if (Item.Name != string.Empty) { this.Text += " [" + Item.Name + "]"; } mComboValues = Enum.GetNames(typeof(EItemBonus)); numSockel.Value = Item.Sockel; txtName.Text = Item.Name; for (int i = 0; i < Item.Bonus.Count; i++) { AddControlRow(); (this.Controls["cb" + i] as ComboBox).SelectedIndex = (int)Item.Bonus[i].Type; (this.Controls["num" + i] as NumericUpDown).Value = Item.Bonus[i].Value; } mBonusCount = Item.Bonus.Count; }
private void EquipmentImg_Click(object sender, EventArgs e) { if (!(sender is PictureBox)) { return; } PictureBox box = sender as PictureBox; string itemType = box.Name.Substring(3); SItem item = mStats.GetItemFromName(itemType).Clone() as SItem; if (box == imgWaffe) { frmItemBonusWeapon frm = new frmItemBonusWeapon(item, itemType); if (frm.ShowDialog() != DialogResult.OK) { return; } item.Name = frm.txtName.Text; item.Sockel = (int)frm.numSockel.Value; item.Bonus = frm.GetBonusList(); item.WeaponType = (EWeaponType)frm.cbWeaponType.SelectedIndex; } else { frmItemBonus frm = new frmItemBonus(item, itemType); if (frm.ShowDialog() != DialogResult.OK) { return; } item.Name = frm.txtName.Text; item.Sockel = (int)frm.numSockel.Value; item.Bonus = frm.GetBonusList(); item.WeaponType = EWeaponType.None; } if (item.Name == string.Empty && item.Bonus.Count > 0) { item.Name = itemType; } else if (item.Name == string.Empty && item.Bonus.Count == 0) { item = SItem.Empty.Clone() as SItem; } if (item.Equals(SItem.Empty)) { box.Image = null; } else { box.Image = Bitmap.FromStream(mAssembly.GetManifestResourceStream("Ssc.Resources.EQ_" + itemType + ".png")); } mStats.SaveItemByName(itemType, item); if (mStats.GetItemFromName(itemType) == SItem.Empty) { box.Image = null; } box.Invalidate(); UpdateAll(); }
public void SaveItemByName( string Name, SItem newItem ) { switch( Name ) { case "Schuhe": ItemSchuhe = newItem.Clone() as SItem; break; case "Handschuh": ItemHandschuhe = newItem.Clone() as SItem; break; case "Hose": ItemHose = newItem.Clone() as SItem; break; case "Rüstung": ItemRüstung = newItem.Clone() as SItem; break; case "Helm": ItemHelm = newItem.Clone() as SItem; break; case "Armreif1": ItemArmreif1 = newItem.Clone() as SItem; break; case "Armreif2": ItemArmreif2 = newItem.Clone() as SItem; break; case "Ring1": ItemRing1 = newItem.Clone() as SItem; break; case "Ring2": ItemRing2 = newItem.Clone() as SItem; break; case "Reittier": ItemReitTier = newItem.Clone() as SItem; break; case "Amulett": ItemAmulett = newItem.Clone() as SItem; break; case "Mantel": ItemMantel = newItem.Clone() as SItem; break; case "Schild": ItemSchild = newItem.Clone() as SItem; break; case "Waffe": ItemWaffe = newItem.Clone() as SItem; break; } }
public void SetItem( out SItem Item, SItem newItem ) { Item = newItem.Clone() as SItem; }
public void SaveItemByName(string Name, SItem newItem) { switch (Name) { case "Schuhe": ItemSchuhe = newItem.Clone() as SItem; break; case "Handschuh": ItemHandschuhe = newItem.Clone() as SItem; break; case "Hose": ItemHose = newItem.Clone() as SItem; break; case "Rüstung": ItemRüstung = newItem.Clone() as SItem; break; case "Helm": ItemHelm = newItem.Clone() as SItem; break; case "Armreif1": ItemArmreif1 = newItem.Clone() as SItem; break; case "Armreif2": ItemArmreif2 = newItem.Clone() as SItem; break; case "Ring1": ItemRing1 = newItem.Clone() as SItem; break; case "Ring2": ItemRing2 = newItem.Clone() as SItem; break; case "Reittier": ItemReitTier = newItem.Clone() as SItem; break; case "Amulett": ItemAmulett = newItem.Clone() as SItem; break; case "Mantel": ItemMantel = newItem.Clone() as SItem; break; case "Schild": ItemSchild = newItem.Clone() as SItem; break; case "Waffe": ItemWaffe = newItem.Clone() as SItem; break; } }
public void SetItem(out SItem Item, SItem newItem) { Item = newItem.Clone() as SItem; }
public bool Equals( SItem other ) { if( other == null || this == null ) return false; if( other.Bonus.Count != this.Bonus.Count ) return false; if( other.Name != this.Name ) return false; if( other.Sockel != this.Sockel ) return false; if( other.WeaponType != this.WeaponType ) return false; return true; }
public object Clone() { SItem i = new SItem( mName, mSockel, mWeaponType ); i.Bonus.AddRange( mBonus ); return i; }