remove common area calculation
This commit is contained in:
26
src/Data.js
26
src/Data.js
@@ -32,30 +32,14 @@ class Flat {
|
||||
return room ? this.sizeShared / this.numPeople * room.numPeople : 0;
|
||||
}
|
||||
|
||||
// Calculates the share of the project wide common area
|
||||
// the party has to pay for.
|
||||
// Currently done by number of people in the party.
|
||||
calcCommonAreaShare(room = null) {
|
||||
var numPeople;
|
||||
if (room) {
|
||||
numPeople = room.numPeople;
|
||||
} else {
|
||||
numPeople = this.numRooms;
|
||||
}
|
||||
|
||||
return commonArea / numPeopleTotal * numPeople;
|
||||
}
|
||||
|
||||
// Calculates the total area the party has to pay for
|
||||
// Includes the private area, share of the common area and for
|
||||
// WGs and clusters the share of the internal shared area
|
||||
// Includes the private area and if applicable share of
|
||||
// the internal common area of WGs and cluster flats
|
||||
calcTotalPayedArea(room = null) {
|
||||
var commonAreaShare = this.calcCommonAreaShare(room);
|
||||
|
||||
if (!room) {
|
||||
return this.sizePrivate + commonAreaShare;
|
||||
return this.sizePrivate;
|
||||
} else {
|
||||
return room.size + commonAreaShare + this.calcInternalAreaShare(room);
|
||||
return room.size + this.calcInternalAreaShare(room);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,8 +113,6 @@ const addedCost = 1.2;
|
||||
export const minRent = 9.45 + addedCost;
|
||||
export const maxRent = 13.06 + addedCost;
|
||||
|
||||
const commonArea = 388.80;
|
||||
|
||||
// Calculate total number of people
|
||||
var _numPeople = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user