Beispiel #1
0
    //////////////////////
    // Auxiliar Methods //
    //////////////////////

    void SetInitialValues(PLACE leisurePlace, LeisureSchedule schedule, float satisfactionValue, int cost,
                          AVAILABILITY availability, CityPart.PLACE cityPlace)
    {
        Cost              = cost;
        LeisurePlace      = leisurePlace;
        Schedule          = schedule;
        this.availability = availability;
        LeisurePlace      = leisurePlace;
        switch (leisurePlace)
        {
        case PLACE.CINEMA: LeisureType = TYPE.SHOW; break;

        case PLACE.PARK: LeisureType = TYPE.CALM; break;

        case PLACE.GYM: LeisureType = TYPE.SPORT; break;

        case PLACE.DISCO: LeisureType = TYPE.PARTY; break;

        default: LeisureType = TYPE.CALM; break;
        }
        this.availability = availability;
        Satisfaction      = new ConditionableIndex("Satisfacción", "Representa como de satisfactorio es ir a " + Global.Names.leisurePlaces[(int)leisurePlace]
                                                   + " en el barrio " + Global.Names.cityPart[(int)cityPlace], satisfactionValue);
        CityPlace = cityPlace;
    }
Beispiel #2
0
    ////////////////////
    // Public Methods //
    ////////////////////

    public void SetAvailability(AVAILABILITY newAvailability)
    {
        this.availability = newAvailability;
        Schedule          = new LeisureSchedule(Global.Values.leisureOpening[(int)LeisurePlace],
                                                Global.Values.leisureOpenedTime[(int)availability, (int)LeisurePlace],
                                                Global.Values.leisureTime[(int)LeisurePlace]);
    }
Beispiel #3
0
    //////////////////
    // Constructors //
    //////////////////

    public Leisure(PLACE leisurePlace, AVAILABILITY availability, CityPart.PLACE cityPlace)
    {
        LeisureSchedule newSchedule = new LeisureSchedule(Global.Values.leisureOpening[(int)leisurePlace],
                                                          Global.Values.leisureOpenedTime[(int)availability, (int)leisurePlace],
                                                          Global.Values.leisureTime[(int)leisurePlace]);
        float satisfactionValue = Global.Values.leisureSatisfaction[(int)leisurePlace];
        int   cost = Global.Values.leisureCost[(int)leisurePlace];

        SetInitialValues(leisurePlace, newSchedule, satisfactionValue, cost, availability, cityPlace);
    }