Ejemplo n.º 1
0
        public void NewAccountCreated(object sender, NewAccountCreatedArgs e)
        {
            int acctID = currentGame.GetLowestEmptyAccountID();
            int returnID;

            if (e.returnAcc == -1)
            {
                returnID = acctID;
            }
            else if (e.returnAcc == -2)
            {
                returnID = -1;
            }
            else
            {
                returnID = e.returnAcc;
            }

            Account tempAccount = new Account(acctID, e.type, e.investment, e.nick, e.owner, returnID);

            currentGame.accounts.Add(tempAccount);
            currentGame.characters.Find(x => x.ID == e.owner).AddAccountAccess(tempAccount);

            currentGame.accounts.Sort();
            CharacterSelected();
            needToSave = true;
        }
Ejemplo n.º 2
0
        public NewAccount(List <Character> allCharacters, int selectedID, List <Account> allAccounts, string[] i_accountTypes)
        {
            args     = new NewAccountCreatedArgs();
            reinvest = false;
            InitializeComponent();
            allCharas = allCharacters.ToArray();
            foreach (Character chara in allCharacters)
            {
                cb_accountOwner.Items.Add(chara.name);
            }
            cb_accountOwner.SelectedIndex = selectedID;

            allAccount = allAccounts.ToArray();
            cb_reinvestAccount.Items.Add("This Account");
            foreach (Account acc in allAccounts)
            {
                cb_reinvestAccount.Items.Add(acc.GetAccountName());
            }

            accountTypes = i_accountTypes;
            cb_accountType.Items.AddRange(i_accountTypes);
        }
Ejemplo n.º 3
0
        public virtual void OnNewAccountCreated(NewAccountCreatedArgs e)
        {
            EventHandler <NewAccountCreatedArgs> handler = NewAccountCreated;

            handler?.Invoke(this, e);
        }