Ejemplo n.º 1
0
    //////////////////
    // Constructors //
    //////////////////

    public Transport(TYPE transportType, EXPANSION expansion, ENHANCEMENTS enhancements, CityPart.PLACE cityPlace)
    {
        float safetyValue     = Global.Values.transportSafety[(int)transportType];
        float wearValue       = 0f;
        int   capacity        = Global.Values.transportCapacity[(int)expansion, (int)transportType];
        float maxSpeed        = Global.Values.transportMaxSpeed[(int)enhancements, (int)transportType];
        float speedIndexValue = 1f;
        float pollutingValue  = Global.Values.transportPollution[(int)transportType];

        SetInitialValues(transportType, safetyValue, wearValue, capacity, maxSpeed, speedIndexValue,
                         pollutingValue, expansion, enhancements, cityPlace);
    }
Ejemplo n.º 2
0
    //////////////////////
    // Auxiliar Methods //
    //////////////////////

    void SetInitialValues(TYPE transportType, float safetyValue, float wearValue, int capacity, float maxSpeed, float speedIndexValue,
                          float pollutingValue, EXPANSION expansion, ENHANCEMENTS enhancements, CityPart.PLACE cityPlace)
    {
        CityPlace         = cityPlace;
        this.expansion    = expansion;
        this.enhancements = enhancements;
        TransportType     = transportType;
        Safety            = new DependentIndex("Seguridad", "Representa como de seguro es desplazarse por " + Global.Names.transport[(int)transportType]
                                               + " en el barrio " + Global.Names.cityPart[(int)cityPlace], safetyValue);
        Polluting = new DependentIndex("Contaminante", "Representa como de contaminante es despalzarse por "
                                       + Global.Names.transport[(int)transportType] + " en el barrio " + Global.Names.cityPart[(int)cityPlace], pollutingValue);
        Wear = new DependentIndex("Desgaste", "Representa como de desgastado está el transporte por "
                                  + Global.Names.transport[(int)transportType] + " en el barrio " + Global.Names.cityPart[(int)cityPlace], wearValue);
        Capacity   = capacity;
        Speed      = maxSpeed;
        SpeedIndex = new DependentIndex("Velocidad", "Representa que cantidad de la velocidad máxima es alcanzable viajando por "
                                        + Global.Names.transport[(int)transportType] + " en el barrio " + Global.Names.cityPart[(int)cityPlace], speedIndexValue);
    }
Ejemplo n.º 3
0
 public void SetEnhancements(ENHANCEMENTS newMaintenanceState)
 {
     this.enhancements = newMaintenanceState;
     Speed             = Global.Values.transportMaxSpeed[(int)enhancements, (int)TransportType];
 }