Exemplo n.º 1
0
    public void AddCityStayWithPkg(City city, SightseeingPackage package)
    {
        CityStay newStay = new CityStay(city, package.days);

        Trip.AddStay(newStay);

        if (Trip.arrivedInTime)
        {
            CulturePoints += package.culturePoints;
        }

        UsePackageResources(package);
    }
Exemplo n.º 2
0
    private void UseCityStayResources(CityStay stay)
    {
        float days = stay.DaysStaytime;
        float costs;

        CulturePoints += Trip.CurrentCity.CulturePointsPer12Hrs * 2 * days;
        CulturePoints += UnityEngine.Random.Range(-2, 3); // + or - 2 points randomly

        if (days > 1)
        {
            costs = days * stay.City.CostsPerNight[Avatar.AvatarType];
        }
        else
        {
            costs = stay.City.CostsPerDay[Avatar.AvatarType];
        }

        Resources[typeof(MoneyResource)].Use(costs);
        NotifyObservers(Resources);
    }
Exemplo n.º 3
0
 public void AddStay(CityStay stay)
 {
     route.Add(stay);
 }