﻿function PedPunish(bEnable, dMultiplier, iAbsolute)
{
	this.bEnable = bEnable;
	this.dMultiplier = dMultiplier;
	this.iAbsolute = iAbsolute;

	var me = this;

	this.Compare = function(you)
	{
		if(me.bEnable != you.bEnable)
			return false;
		if(me.bEnable)
		{
			if(me.dMultiplier != you.dMultiplier)
				return false;
			if(me.iAbsolute != you.iAbsolute)
				return false;
		}
		return true;
	}
	
	this.GetCopy = function()
	{
		var copy = new PedPunish();
		copy.bEnable = me.bEnable;
		copy.dMultiplier = me.dMultiplier;
		copy.iAbsolute = me.iAbsolute;
		return copy;
	}
}

function ACCPedSetting(iVehicles,ppPedestrianBicycle,ppPedestrianMotorized,ppPavedPoor,
						ppUnPaved,ppNonTactiled,ppStairs,ppHighGradient,ppLowGradient,ppTolled,ppHighCurbside,
						ppPedCrossing,ppOtherPassThrough,ppNoTrafficLight,ppNoNoticeSignal,ppNoPressButton,
                        ppMovingStairs, ppElevator )
{
	this.iVehicles = iVehicles;
	this.ppPedestrianBicycle = ppPedestrianBicycle;     // Pedestrian + bicycle.
	this.ppPedestrianMotorized = ppPedestrianMotorized;     // Pedestrian + motorized vehicle.
	this.ppPavedPoor           = ppPavedPoor;     // Poor quality paved.
	this.ppUnPaved             = ppUnPaved;     // Unpaved.
	this.ppNonTactiled         = ppNonTactiled;     // Non-tactiled route.
	this.ppStairs              = ppStairs;     // Stairs.
	this.ppHighGradient        = ppHighGradient;     // Sheer.
	this.ppLowGradient         = ppLowGradient;     // Descent.
	this.ppTolled              = ppTolled;     // Pay.
	this.ppHighCurbside        = ppHighCurbside;     // High curbside.
	this.ppPedCrossing         = ppPedCrossing;     // Pedestrian crossing (zebra).
	this.ppOtherPassThrough    = ppOtherPassThrough;      // Other pass through possibility (no ped.crossing, subway, overpass).
	this.ppNoTrafficLight      = ppNoTrafficLight;     // Crossing without traffic light.
	this.ppNoNoticeSignal      = ppNoNoticeSignal;     // Crossing without notice signal.
	this.ppNoPressButton       = ppNoPressButton;     // Crossing with no press button.
	this.ppMovingStairs        = ppMovingStairs;     // Moving stairs.
	this.ppElevator            = ppElevator;         // Elevator.

	var me = this;

	this.Compare = function(you)
	{
		if (me.iVehicles != you.iVehicles)
			return false;
        if (!me.ppPedestrianBicycle.Compare(you.ppPedestrianBicycle))     // Pedestrian + bicycle.
			return false;
		if(!me.ppPedestrianMotorized.Compare( you.ppPedestrianMotorized))     // Pedestrian + motorized vehicle.
			return false;
		if(!me.ppPavedPoor.Compare( you.ppPavedPoor))     // Poor quality paved.
			return false;
		if(!me.ppUnPaved.Compare( you.ppUnPaved))     // Unpaved.
			return false;
		if(!me.ppNonTactiled.Compare( you.ppNonTactiled))     // Non-tactiled route.
			return false;
		if(!me.ppStairs.Compare( you.ppStairs))     // Stairs.
			return false;
		if(!me.ppHighGradient.Compare( you.ppHighGradient))     // Sheer.
			return false;
		if(!me.ppLowGradient.Compare( you.ppLowGradient))     // Descent.
			return false;
		if(!me.ppTolled.Compare( you.ppTolled))     // Pay.
			return false;
		if(!me.ppHighCurbside.Compare( you.ppHighCurbside))     // High curbside.
			return false;
		if(!me.ppPedCrossing.Compare( you.ppPedCrossing))     // Pedestrian crossing (zebra)).
			return false;
		if(!me.ppOtherPassThrough.Compare( you.ppOtherPassThrough))      // Other pass through possibility (no ped.crossing, subway, overpass)).
			return false;
		if(!me.ppNoTrafficLight.Compare( you.ppNoTrafficLight))     // Crossing without traffic light.
			return false;
		if(!me.ppNoNoticeSignal.Compare( you.ppNoNoticeSignal))     // Crossing without notice signal.
			return false;
		if(!me.ppNoPressButton.Compare( you.ppNoPressButton))     // Crossing with no press button.
			return false;
		if (!me.ppMovingStairs.Compare(you.ppMovingStairs))     // Moving stairs.
		    return false;
		if (!me.ppElevator.Compare(you.ppElevator))     // Elevator.
		    return false;

		return true;
	}

	this.GetCopy = function () {
	    var copy = new ACCPedSetting();
	    copy.iVehicles = me.iVehicles;
	    copy.ppPedestrianBicycle = me.ppPedestrianBicycle.GetCopy();     // Pedestrian + bicycle.
	    copy.ppPedestrianMotorized = me.ppPedestrianMotorized.GetCopy();     // Pedestrian + motorized vehicle.
	    copy.ppPavedPoor = me.ppPavedPoor.GetCopy();     // Poor quality paved.
	    copy.ppUnPaved = me.ppUnPaved.GetCopy();     // Unpaved.
	    copy.ppNonTactiled = me.ppNonTactiled.GetCopy();     // Non-tactiled route.
	    copy.ppStairs = me.ppStairs.GetCopy();     // Stairs.
	    copy.ppHighGradient = me.ppHighGradient.GetCopy();     // Sheer.
	    copy.ppLowGradient = me.ppLowGradient.GetCopy();     // Descent.
	    copy.ppTolled = me.ppTolled.GetCopy();     // Pay.
	    copy.ppHighCurbside = me.ppHighCurbside.GetCopy();     // High curbside.
	    copy.ppPedCrossing = me.ppPedCrossing.GetCopy();     // Pedestrian crossing (zebra).
	    copy.ppOtherPassThrough = me.ppOtherPassThrough.GetCopy();      // Other pass through possibility (no ped.crossing, subway, overpass).
	    copy.ppNoTrafficLight = me.ppNoTrafficLight.GetCopy();     // Crossing without traffic light.
	    copy.ppNoNoticeSignal = me.ppNoNoticeSignal.GetCopy();     // Crossing without notice signal.
	    copy.ppNoPressButton = me.ppNoPressButton.GetCopy();     // Crossing with no press button.
	    copy.ppMovingStairs = me.ppMovingStairs.GetCopy();     // Moving stairs.
	    copy.ppElevator = me.ppElevator.GetCopy();     // Elevator.
	    return copy;
	}
}