101 lines
1.5 KiB
TypeScript
101 lines
1.5 KiB
TypeScript
const { ccclass, property } = cc._decorator;
|
|
|
|
//#region Class
|
|
|
|
/** 成員資料 */
|
|
export class MemberData {
|
|
|
|
public Name: string;
|
|
|
|
public AvatarId: number;
|
|
|
|
public Score: ScoreResult;
|
|
|
|
/**
|
|
* @param {string} name 名稱
|
|
*/
|
|
constructor(name: string) {
|
|
this.Name = name;
|
|
|
|
}
|
|
}
|
|
|
|
/** AvatarData */
|
|
export class AvatarData {
|
|
|
|
public ID: number;
|
|
|
|
public Model: number;
|
|
|
|
public Name: string;
|
|
|
|
public Desc: string;
|
|
|
|
public Pic: cc.SpriteFrame;
|
|
|
|
public BigPic: cc.SpriteFrame;
|
|
|
|
public BG: cc.SpriteFrame;
|
|
|
|
public color: AvatarColor;
|
|
}
|
|
|
|
/** 分數結果 */
|
|
export class ScoreResult {
|
|
|
|
public Win: number;
|
|
|
|
public Total: number;
|
|
}
|
|
|
|
/**
|
|
* 比賽記錄
|
|
* {time,team:[[name1,name2],[name3,name4]],type,score:[t1,t2] }
|
|
*/
|
|
export class GameRecord {
|
|
|
|
/** 場次 */
|
|
public Seq: number;
|
|
|
|
/** 記錄時間 */
|
|
public Time: number;
|
|
|
|
/** 遊戲類型(0:雙打,1:單打) */
|
|
public Type: number;
|
|
|
|
/** 玩家隊伍 [ [隊伍1成員], [隊伍2成員] ] */
|
|
public Team: string[][];
|
|
|
|
/** players */
|
|
public Players: string[];
|
|
|
|
/** 隊伍分數 [ [隊伍1分數], [隊伍2分數] ] */
|
|
public Score: number[];
|
|
}
|
|
|
|
/** GameConfig */
|
|
export class GameConfig {
|
|
|
|
/** Members */
|
|
public Members: string[];
|
|
}
|
|
|
|
/** AvatarSettings */
|
|
export class AvatarSettings {
|
|
|
|
/** Avatars */
|
|
public Avatars: AvatarData[];
|
|
}
|
|
|
|
//#endregion
|
|
|
|
//#region Enum
|
|
|
|
/** AvatarColor */
|
|
export enum AvatarColor {
|
|
None,
|
|
Pink,
|
|
Yellow
|
|
}
|
|
|
|
//#endregion
|