mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 13:17:32 +00:00
card basic
This commit is contained in:
parent
51fb65cdb4
commit
cd0793655d
32 changed files with 807 additions and 260 deletions
|
|
@ -1,3 +1,8 @@
|
|||
import { element } from '../lib/convert.js';
|
||||
import { Equip, Weapon } from './equip.js';
|
||||
import { Property } from './property.js';
|
||||
import { Skill } from './skill.js';
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
|
|
@ -42,6 +47,8 @@ export class Avatar {
|
|||
this.hollow_icon_path = hollow_icon_path;
|
||||
this.rank = rank;
|
||||
this.is_chosen = is_chosen;
|
||||
|
||||
this.element_str = element.IDToElement(element_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -100,6 +107,8 @@ export class ZZZAvatarBasic {
|
|||
this.icon_paths = icon_paths;
|
||||
this.rank = rank;
|
||||
this.is_chosen = is_chosen;
|
||||
|
||||
this.element_str = element.IDToElement(element_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -128,41 +137,44 @@ export class Rank {
|
|||
*/
|
||||
export class ZZZAvatarInfo {
|
||||
/**
|
||||
* @param {number} id
|
||||
* @param {number} level
|
||||
* @param {string} name_mi18n
|
||||
* @param {string} full_name_mi18n
|
||||
* @param {number} element_type
|
||||
* @param {string} camp_name_mi18n
|
||||
* @param {number} avatar_profession
|
||||
* @param {string} rarity
|
||||
* @param {string} group_icon_path
|
||||
* @param {string} hollow_icon_path
|
||||
* @param {Equip[]} equip
|
||||
* @param {Weapon} weapon
|
||||
* @param {Property[]} properties
|
||||
* @param {Skill[]} skills
|
||||
* @param {number} rank
|
||||
* @param {Rank[]} ranks
|
||||
* @param {{
|
||||
* id: number;
|
||||
* level: number;
|
||||
* name_mi18n: string;
|
||||
* full_name_mi18n: string;
|
||||
* element_type: number;
|
||||
* camp_name_mi18n: string;
|
||||
* avatar_profession: number;
|
||||
* rarity: string;
|
||||
* group_icon_path: string;
|
||||
* hollow_icon_path: string;
|
||||
* equip: Equip[];
|
||||
* weapon: Weapon;
|
||||
* properties: Property[];
|
||||
* skills: Skill[];
|
||||
* rank: number;
|
||||
* ranks: Rank[];
|
||||
* }} data
|
||||
*/
|
||||
constructor(
|
||||
id,
|
||||
level,
|
||||
name_mi18n,
|
||||
full_name_mi18n,
|
||||
element_type,
|
||||
camp_name_mi18n,
|
||||
avatar_profession,
|
||||
rarity,
|
||||
group_icon_path,
|
||||
hollow_icon_path,
|
||||
equip,
|
||||
weapon,
|
||||
properties,
|
||||
skills,
|
||||
rank,
|
||||
ranks
|
||||
) {
|
||||
constructor(data) {
|
||||
const {
|
||||
id,
|
||||
level,
|
||||
name_mi18n,
|
||||
full_name_mi18n,
|
||||
element_type,
|
||||
camp_name_mi18n,
|
||||
avatar_profession,
|
||||
rarity,
|
||||
group_icon_path,
|
||||
hollow_icon_path,
|
||||
equip,
|
||||
weapon,
|
||||
properties,
|
||||
skills,
|
||||
rank,
|
||||
ranks,
|
||||
} = data;
|
||||
this.id = id;
|
||||
this.level = level;
|
||||
this.name_mi18n = name_mi18n;
|
||||
|
|
@ -179,6 +191,8 @@ export class ZZZAvatarInfo {
|
|||
this.skills = skills;
|
||||
this.rank = rank;
|
||||
this.ranks = ranks;
|
||||
|
||||
this.element_str = element.IDToElement(element_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,26 @@
|
|||
/**
|
||||
* @class
|
||||
*/
|
||||
export class Buddy {
|
||||
/**
|
||||
* @param {{
|
||||
* id: number;
|
||||
* name: string;
|
||||
* rarity: string;
|
||||
* level: number;
|
||||
* star: number;
|
||||
* }} data
|
||||
*/
|
||||
constructor(data) {
|
||||
const { id, name, rarity, level, star } = data;
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.rarity = rarity;
|
||||
this.level = level;
|
||||
this.star = star;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,22 +1,5 @@
|
|||
/**
|
||||
* @class
|
||||
*/
|
||||
export class Buddy {
|
||||
/**
|
||||
* @param {number} id
|
||||
* @param {string} name
|
||||
* @param {string} rarity
|
||||
* @param {number} level
|
||||
* @param {number} star
|
||||
*/
|
||||
constructor(id, name, rarity, level, star) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.rarity = rarity;
|
||||
this.level = level;
|
||||
this.star = star;
|
||||
}
|
||||
}
|
||||
import { ZZZAvatarInfo } from './avatar.js';
|
||||
import { Buddy } from './bangboo.js';
|
||||
|
||||
/**
|
||||
* @class
|
||||
|
|
@ -51,7 +34,7 @@ export class ZZZIndexResp {
|
|||
/**
|
||||
* @param {{
|
||||
* stats: Stats;
|
||||
* avatar_list: Avatar[];
|
||||
* avatar_list: ZZZAvatarInfo[];
|
||||
* cur_head_icon_url: string;
|
||||
* buddy_list: Buddy[];
|
||||
* }} data
|
||||
|
|
@ -59,8 +42,8 @@ export class ZZZIndexResp {
|
|||
constructor(data) {
|
||||
const { stats, avatar_list, cur_head_icon_url, buddy_list } = data;
|
||||
this.stats = stats;
|
||||
this.avatar_list = avatar_list;
|
||||
this.avatar_list = avatar_list.map(item => new ZZZAvatarInfo(item));
|
||||
this.cur_head_icon_url = cur_head_icon_url;
|
||||
this.buddy_list = buddy_list;
|
||||
this.buddy_list = buddy_list.map(item => new Buddy(item));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @class
|
||||
*/
|
||||
class Property {
|
||||
export class Property {
|
||||
/**
|
||||
* @param {string} property_name
|
||||
* @param {number} property_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue