예제 #1
0
    public void AddInvestment(Investment.InvestmentType thisType)
    {
        if (playerInvestments.Count < MAX_INVESTMENTS)
        {
        }
        else
        {
            GUIManager.s_instance.DisplayNotification("Notice!", "Investment limit reached.");
            return;
        }

        float cost;

        if (thisType == Investment.InvestmentType.IRA)
        {
            cost = IRA_INIT_COST;
        }
        else if (thisType == Investment.InvestmentType.Mutual)
        {
            cost = MUTUAL_INIT_COST;
        }
        else
        {
            cost = STOCK_INIT_COST;
        }
        if (cost > money)
        {
            GUIManager.s_instance.DisplayNotification("Notice!", "Insufficient funds.");
        }
        else
        {
            Investment newInvestment = new Investment();
            newInvestment.thisInvestmentType = thisType;
            newInvestment.SetMonetaryValue(cost);
            money -= cost;
            playerInvestments.Add(newInvestment);
        }
    }
예제 #2
0
    public void AddInvestment(Investment.InvestmentType thisType)
    {
        if( playerInvestments.Count < MAX_INVESTMENTS ) {

        } else {
            GUIManager.s_instance.DisplayNotification( "Notice!", "Investment limit reached." );
            return;
        }

        float cost;
        if (thisType == Investment.InvestmentType.IRA) {
            cost = IRA_INIT_COST;
        }
        else if (thisType == Investment.InvestmentType.Mutual){
            cost = MUTUAL_INIT_COST;
        }
        else {
            cost = STOCK_INIT_COST;
        }
        if (cost > money) {
            GUIManager.s_instance.DisplayNotification ("Notice!", "Insufficient funds.");
        } else {
            Investment newInvestment = new Investment();
            newInvestment.thisInvestmentType = thisType;
            newInvestment.SetMonetaryValue(cost);
            money -= cost;
            playerInvestments.Add( newInvestment );
        }
    }