Hey! I'm stucking on this problem, don't know what's wrong please help
Server-side:
import { ArraySchema, Schema, type } from "@colyseus/schema";
export class Profile extends Schema {
@type("string")
uid: string = '';
@type("string")
nickname: string = '';
@type("number")
avatar: number = 0;
@type("number")
score: number = 0;
@type("number")
exp: number = 0;
@type("number")
level: number = 0;
};
export class Gamer extends Schema {
/// BUG !!!
@type(Profile)
profile: Profile = new Profile();
@type(["number"])
cards = new ArraySchema<number>();
@type("number")
coins: number = 0;
@type("number")
chips: number = 0;
@type("number")
prize: number = 0;
@type("number")
seat: number = -1;
};
client-side:
using Colyseus.Schema;
namespace Poker.Entities {
/// <summary>
/// Represent gamer datas other gamers could see
/// </summary>
public class Profile : Schema {
[Type(0, "string")]
public string uid = default(string);
[Type(1, "string")]
public string nickname = default(string);
[Type(2, "number")]
public float avatar = default(float);
[Type(3, "number")]
public float score = default(float);
[Type(4, "number")]
public float exp = default(float);
[Type(5, "number")]
public float level = default(float);
}
/// <summary>
/// Instance of user in holdem game
/// </summary>
public class Gamer : Schema
{
[Type(0, "Profile", typeof(Profile))]
public Profile profile = new Profile();
[Type(1, "array", typeof(ArraySchema<float>))]
public ArraySchema<float> cards = new ArraySchema<float>();
[Type(2, "number")]
public float coins = default(float);
[Type(3, "number")]
public float chips = default(float);
[Type(4, "number")]
public float prize = default(float);
[Type(5, "number")]
public float seat = default(float);
}
}
I believe the problem comes from Profile but don't know how to solve that. Thanks.