Add default values to house and biz classes

This commit is contained in:
Vortrex
2020-12-23 23:01:15 -06:00
parent b6cff2c110
commit ce288afb48

View File

@@ -145,10 +145,34 @@ function initClassTable() {
}, },
businessData: class { businessData: class {
constructor(businessAssoc) { constructor(businessAssoc) {
if(!businessAssoc) { this.databaseId = 0;
return; this.name = "";
} this.ownerType = AG_BIZOWNER_NONE;
this.ownerId = 0
this.locked = false
this.entrancePosition = false;
this.entranceRotation = 0.0;
this.entranceInterior = 0;
this.entranceDimension = 0;
this.entrancePickupModel = -1;
this.entranceBlipModel = -1;
this.entrancePickup = null;
this.entranceBlip = null;
this.exitPosition = false;
this.exitRotation = 0.0;
this.exitInterior = 0;
this.exitDimension = 0;
this.exitPickupModel = -1;
this.exitBlipModel = -1;
this.exitPickup = null;
this.exitBlip = null;
this.entranceFee = 0;
this.till = 0
if(businessAssoc != false) {
this.databaseId = toInteger(businessAssoc["biz_id"]); this.databaseId = toInteger(businessAssoc["biz_id"]);
this.name = toString(businessAssoc["biz_name"]); this.name = toString(businessAssoc["biz_name"]);
this.ownerType = toInteger(businessAssoc["biz_owner_type"]); this.ownerType = toInteger(businessAssoc["biz_owner_type"]);
@@ -173,8 +197,10 @@ function initClassTable() {
this.exitPickup = null; this.exitPickup = null;
this.exitBlip = null; this.exitBlip = null;
this.entranceFee = toInteger(businessAssoc["biz_entrance_fee"]);
this.till = toInteger(businessAssoc["biz_till"]); this.till = toInteger(businessAssoc["biz_till"]);
} }
}
}, },
businessLocationData: class { businessLocationData: class {
constructor(businessLocationAssoc) { constructor(businessLocationAssoc) {
@@ -195,10 +221,31 @@ function initClassTable() {
}, },
houseData: class { houseData: class {
constructor(houseAssoc) { constructor(houseAssoc) {
if(!houseAssoc) { this.databaseId = 0
return false; this.description = "";
} this.ownerType = AG_HOUSEOWNER_NONE;
this.ownerId = 0
this.locked = false;
this.entrancePosition = false;
this.entranceRotation = 0.0;
this.entranceInterior = 0;
this.entranceDimension = 0;
this.entrancePickupModel = -1;
this.entranceBlipModel = -1;
this.entrancePickup = null;
this.entranceBlip = null;
this.exitPosition = false;
this.exitRotation = 0.0;
this.exitInterior = 0;
this.exitDimension = -1;
this.exitPickupModel = -1;
this.exitBlipModel = -1;
this.exitPickup = null;
this.exitBlip = null;
if(houseAssoc != false) {
this.databaseId = toInteger(houseAssoc["house_id"]); this.databaseId = toInteger(houseAssoc["house_id"]);
this.description = toString(houseAssoc["house_description"]); this.description = toString(houseAssoc["house_description"]);
this.ownerType = toInteger(houseAssoc["house_owner_type"]); this.ownerType = toInteger(houseAssoc["house_owner_type"]);
@@ -223,6 +270,7 @@ function initClassTable() {
this.exitPickup = null; this.exitPickup = null;
this.exitBlip = null; this.exitBlip = null;
} }
}
}, },
familyData: class { familyData: class {