예제 #1
0
    public IEnumerator Income()
    {
        int income      = 0;
        int familyCount = 0;

        foreach (Family family in families)
        {
            FirstClassFamily firstClassFamily = (FirstClassFamily)family;
            if (firstClassFamily != null)
            {
                familyCount++;
                income = firstClassFamily.Income;
            }
        }
        Debug.Log(familyCount + " families had an income of " + income);
        ResourceManager.instance.Income(income);
        yield return(null);
    }
예제 #2
0
    public Family CreateOne(TravelClass travelClass)
    {
        Family family  = null;
        string surname = Data.RandomElement(Data.surnames);

        switch (travelClass)
        {
        case TravelClass.First:
            family = new FirstClassFamily(surname, chances, firstClassFunds, firstClassIncome);
            break;

        case TravelClass.Second:
            break;

        case TravelClass.Third:
            break;
        }
        return(family);
    }
예제 #3
0
    public void FinishedChoosing(Family[] families)
    {
        this.families.AddRange(families);
        car.MoveIn(families);

        foreach (Family family in families)
        {
            foreach (PassengerData member in family.blueprints)
            {
                Passenger passenger = PassengerFactory.instance.Instantiate(car, member);
                family.members.Add(passenger);
            }

            FirstClassFamily firstClassFamily = (FirstClassFamily)family;
            if (firstClassFamily != null)
            {
                ResourceManager.instance.Income(firstClassFamily.funds);
            }
        }

        ChoosingFamily = false;
    }