@armoury/fivem-roleplay-gamemode-common 1.0.40 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.House = void 0;
|
|
4
15
|
var House = /** @class */ (function () {
|
|
5
|
-
function House(id, owner, entrance, exit, originalValue, sellingPrice, rentPrice, requiredLevel) {
|
|
16
|
+
function House(id, owner, entrance, exit, originalValue, address, sellingPrice, rentPrice, requiredLevel, metadata) {
|
|
6
17
|
if (sellingPrice === void 0) { sellingPrice = 0; }
|
|
7
18
|
if (rentPrice === void 0) { rentPrice = 0; }
|
|
8
19
|
if (requiredLevel === void 0) { requiredLevel = 1; }
|
|
@@ -11,9 +22,12 @@ var House = /** @class */ (function () {
|
|
|
11
22
|
this.entrance = entrance;
|
|
12
23
|
this.exit = exit;
|
|
13
24
|
this.originalValue = originalValue;
|
|
25
|
+
this.address = address;
|
|
14
26
|
this.sellingPrice = sellingPrice;
|
|
15
27
|
this.rentPrice = rentPrice;
|
|
16
28
|
this.requiredLevel = requiredLevel;
|
|
29
|
+
this.metadata = __assign(__assign({}, (metadata !== null && metadata !== void 0 ? metadata : {})), { isOwned: owner != null, tenants: 0, maxTenants: 10, acceptsTenants: true, // TODO: Implement this
|
|
30
|
+
address: address });
|
|
17
31
|
}
|
|
18
32
|
House.toStub = function (house) {
|
|
19
33
|
return {
|
|
@@ -21,6 +35,7 @@ var House = /** @class */ (function () {
|
|
|
21
35
|
sellingPrice: house.sellingPrice,
|
|
22
36
|
rentPrice: house.rentPrice,
|
|
23
37
|
requiredLevel: house.requiredLevel,
|
|
38
|
+
metadata: house.metadata,
|
|
24
39
|
};
|
|
25
40
|
};
|
|
26
41
|
return House;
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
var House = /** @class */ (function () {
|
|
2
|
-
function House(id, owner, entrance, exit, originalValue, sellingPrice, rentPrice, requiredLevel) {
|
|
13
|
+
function House(id, owner, entrance, exit, originalValue, address, sellingPrice, rentPrice, requiredLevel, metadata) {
|
|
3
14
|
if (sellingPrice === void 0) { sellingPrice = 0; }
|
|
4
15
|
if (rentPrice === void 0) { rentPrice = 0; }
|
|
5
16
|
if (requiredLevel === void 0) { requiredLevel = 1; }
|
|
@@ -8,9 +19,12 @@ var House = /** @class */ (function () {
|
|
|
8
19
|
this.entrance = entrance;
|
|
9
20
|
this.exit = exit;
|
|
10
21
|
this.originalValue = originalValue;
|
|
22
|
+
this.address = address;
|
|
11
23
|
this.sellingPrice = sellingPrice;
|
|
12
24
|
this.rentPrice = rentPrice;
|
|
13
25
|
this.requiredLevel = requiredLevel;
|
|
26
|
+
this.metadata = __assign(__assign({}, (metadata !== null && metadata !== void 0 ? metadata : {})), { isOwned: owner != null, tenants: 0, maxTenants: 10, acceptsTenants: true, // TODO: Implement this
|
|
27
|
+
address: address });
|
|
14
28
|
}
|
|
15
29
|
House.toStub = function (house) {
|
|
16
30
|
return {
|
|
@@ -18,6 +32,7 @@ var House = /** @class */ (function () {
|
|
|
18
32
|
sellingPrice: house.sellingPrice,
|
|
19
33
|
rentPrice: house.rentPrice,
|
|
20
34
|
requiredLevel: house.requiredLevel,
|
|
35
|
+
metadata: house.metadata,
|
|
21
36
|
};
|
|
22
37
|
};
|
|
23
38
|
return House;
|
|
@@ -8,6 +8,7 @@ export interface House {
|
|
|
8
8
|
readonly sellingPrice: number;
|
|
9
9
|
readonly rentPrice: number;
|
|
10
10
|
readonly requiredLevel: number;
|
|
11
|
+
metadata?: HouseMetadata;
|
|
11
12
|
}
|
|
12
13
|
export declare class House {
|
|
13
14
|
readonly id: number;
|
|
@@ -15,12 +16,21 @@ export declare class House {
|
|
|
15
16
|
readonly entrance: Position;
|
|
16
17
|
readonly exit: Position;
|
|
17
18
|
readonly originalValue: number;
|
|
19
|
+
readonly address: string;
|
|
18
20
|
readonly sellingPrice: number;
|
|
19
21
|
readonly rentPrice: number;
|
|
20
22
|
readonly requiredLevel: number;
|
|
21
|
-
|
|
23
|
+
metadata?: HouseMetadata;
|
|
24
|
+
constructor(id: number, owner: number | null, entrance: Position, exit: Position, originalValue: number, address: string, sellingPrice?: number, rentPrice?: number, requiredLevel?: number, metadata?: HouseMetadata);
|
|
22
25
|
static toStub(house: House): Stub<House>;
|
|
23
26
|
}
|
|
27
|
+
export interface HouseMetadata {
|
|
28
|
+
isOwned?: boolean;
|
|
29
|
+
tenants?: number;
|
|
30
|
+
maxTenants?: number;
|
|
31
|
+
acceptsTenants?: boolean;
|
|
32
|
+
address?: string;
|
|
33
|
+
}
|
|
24
34
|
type Position = {
|
|
25
35
|
x: number;
|
|
26
36
|
y: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { House } from './models/house/house';
|
|
1
|
+
import type { House, HouseMetadata } from './models/house/house';
|
|
2
2
|
declare module '@armoury/fivem-framework-common' {
|
|
3
3
|
interface StubFieldRegistry {
|
|
4
4
|
House: {
|
|
@@ -7,6 +7,7 @@ declare module '@armoury/fivem-framework-common' {
|
|
|
7
7
|
sellingPrice: number;
|
|
8
8
|
rentPrice: number;
|
|
9
9
|
requiredLevel: number;
|
|
10
|
+
metadata?: HouseMetadata;
|
|
10
11
|
};
|
|
11
12
|
};
|
|
12
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@armoury/fivem-roleplay-gamemode-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.47",
|
|
4
4
|
"description": "Shared APIs for the Armoury FiveM roleplay gamemode",
|
|
5
5
|
"main": "dist/cjs/shared/index.js",
|
|
6
6
|
"module": "dist/esm/shared/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"files": ["dist"],
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@armoury/fivem-framework-common": "^1.0.
|
|
17
|
+
"@armoury/fivem-framework-common": "^1.0.46"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "npm run build:cjs && npm run build:esm && npm run build:types",
|