Exemplo n.º 1
0
 public CardEditorControl(TabPage parent, Card cardToEdit)
 {
     m_Loading = true;
     m_tabParent = parent;
     m_Card = cardToEdit;
     InitializeComponent();
     m_aeAbilityDisplay = new List<AbilityEditor>();
     PopulateFields();
     m_Loading = false;
 }
Exemplo n.º 2
0
        private void PutFieldDataOnCard()
        {
            if (m_Loading)
            {
                return;
            }
            if (m_Card == null)
            {
                m_Card = new Unit();
            }
            m_Card.Name = m_txtName.Text;
            m_Card.Faction = m_cbxFactions.Text;
            //m_Card.Type = (CardTypes)Enum.Parse(typeof(CardTypes), m_cbxType.Text);
            m_Card.UseCost = Int32.Parse(m_cbxUseCost.Text);
            m_Card.Set = m_cbxSet.Text;
            m_Card.Rarity = m_cbxRarity.SelectedIndex;
            if (m_Card.Type == CardTypes.Unit)
            {
                Unit cardEditing = (Unit)m_Card;
                cardEditing.BaseFirepower = Int32.Parse(m_cbxFirepower.Text);
            }

            m_Card.Flavor = m_txtFlavor.Text;
            if (m_Card.Creds == null)
            {
                m_Card.Creds = new Credits();
            }
            m_Card.Abilities.Clear();
            foreach (AbilityEditor abilityrep in m_aeAbilityDisplay)
            {
                m_Card.Abilities.Add(abilityrep.Ability);
            }
            m_Card.Creds.Designer = "RH";
        }