Spaces:
Sleeping
Sleeping
serialize descriptions
Browse files
patches/convex/aiTown/playerDescription.ts
CHANGED
@@ -17,15 +17,16 @@ export class PlayerDescription {
|
|
17 |
role:string;
|
18 |
|
19 |
constructor(serialized: SerializedPlayerDescription) {
|
20 |
-
const { playerId, name, description, character } = serialized;
|
21 |
this.playerId = parseGameId('players', playerId);
|
22 |
this.name = name;
|
23 |
this.description = description;
|
24 |
this.character = character;
|
|
|
25 |
}
|
26 |
|
27 |
serialize(): SerializedPlayerDescription {
|
28 |
-
const { playerId, name, description, character } = this;
|
29 |
return {
|
30 |
playerId,
|
31 |
name,
|
|
|
17 |
role:string;
|
18 |
|
19 |
constructor(serialized: SerializedPlayerDescription) {
|
20 |
+
const { playerId, name, description, character,role } = serialized;
|
21 |
this.playerId = parseGameId('players', playerId);
|
22 |
this.name = name;
|
23 |
this.description = description;
|
24 |
this.character = character;
|
25 |
+
this.character=role;
|
26 |
}
|
27 |
|
28 |
serialize(): SerializedPlayerDescription {
|
29 |
+
const { playerId, name, description, character, role} = this;
|
30 |
return {
|
31 |
playerId,
|
32 |
name,
|