mirror of
https://github.com/yoncodes/BD2PS.git
synced 2026-08-05 22:32:13 +02:00
pushing
This commit is contained in:
9
data/Cargo.toml
Normal file
9
data/Cargo.toml
Normal file
@@ -0,0 +1,9 @@
|
||||
[package]
|
||||
name = "data"
|
||||
edition.workspace = true
|
||||
version.workspace = true
|
||||
|
||||
[dependencies]
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
anyhow.workspace = true
|
||||
66
data/src/exceldb/achievementleveltable.rs
Normal file
66
data/src/exceldb/achievementleveltable.rs
Normal file
@@ -0,0 +1,66 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Achievementleveltable {
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "needEXP")]
|
||||
pub need_e_x_p: i32,
|
||||
#[serde(rename = "rewardCount")]
|
||||
pub reward_count: Vec<i32>,
|
||||
#[serde(rename = "rewardId")]
|
||||
pub reward_id: Vec<i32>,
|
||||
#[serde(rename = "rewardType")]
|
||||
pub reward_type: Vec<i32>,
|
||||
}
|
||||
|
||||
pub struct AchievementleveltableTable {
|
||||
records: Vec<Achievementleveltable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl AchievementleveltableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Achievementleveltable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Achievementleveltable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Achievementleveltable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Achievementleveltable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
106
data/src/exceldb/achievementtable.rs
Normal file
106
data/src/exceldb/achievementtable.rs
Normal file
@@ -0,0 +1,106 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Achievementtable {
|
||||
#[serde(rename = "conditionSubType")]
|
||||
pub condition_sub_type: Option<i32>,
|
||||
#[serde(rename = "conditionType")]
|
||||
pub condition_type: i32,
|
||||
#[serde(rename = "conditionValue")]
|
||||
pub condition_value: f32,
|
||||
#[serde(rename = "contentsGroup")]
|
||||
pub contents_group: Option<i32>,
|
||||
#[serde(rename = "descLocalTextId")]
|
||||
pub desc_local_text_id: i32,
|
||||
#[serde(rename = "eventType")]
|
||||
pub event_type: i32,
|
||||
#[serde(rename = "exp")]
|
||||
pub exp: Option<i32>,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "iconName")]
|
||||
pub icon_name: String,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "parentGroupId")]
|
||||
pub parent_group_id: Option<i32>,
|
||||
#[serde(rename = "rewardItemCount")]
|
||||
pub reward_item_count: Option<Vec<i32>>,
|
||||
#[serde(rename = "rewardItemId")]
|
||||
pub reward_item_id: Option<Vec<i32>>,
|
||||
#[serde(rename = "rewardItemType")]
|
||||
pub reward_item_type: Option<Vec<i32>>,
|
||||
#[serde(rename = "shortCutId")]
|
||||
pub short_cut_id: Option<i32>,
|
||||
#[serde(rename = "tabType")]
|
||||
pub tab_type: Option<i32>,
|
||||
#[serde(rename = "titleLocalTextId")]
|
||||
pub title_local_text_id: i32,
|
||||
#[serde(rename = "useBlind")]
|
||||
pub use_blind: Option<i32>,
|
||||
#[serde(rename = "useType")]
|
||||
pub use_type: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct AchievementtableTable {
|
||||
records: Vec<Achievementtable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl AchievementtableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Achievementtable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Achievementtable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Achievementtable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Achievementtable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Achievementtable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
70
data/src/exceldb/actiongameattacktable.rs
Normal file
70
data/src/exceldb/actiongameattacktable.rs
Normal file
@@ -0,0 +1,70 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Actiongameattacktable {
|
||||
#[serde(rename = "attackType")]
|
||||
pub attack_type: Option<i32>,
|
||||
#[serde(rename = "groggySkillValue")]
|
||||
pub groggy_skill_value: Option<i32>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "repeatCount")]
|
||||
pub repeat_count: Option<i32>,
|
||||
#[serde(rename = "skillValue")]
|
||||
pub skill_value: Option<f32>,
|
||||
#[serde(rename = "specialGaugeValue")]
|
||||
pub special_gauge_value: Option<i32>,
|
||||
#[serde(rename = "unblockableType")]
|
||||
pub unblockable_type: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct ActiongameattacktableTable {
|
||||
records: Vec<Actiongameattacktable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl ActiongameattacktableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Actiongameattacktable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Actiongameattacktable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Actiongameattacktable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Actiongameattacktable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
78
data/src/exceldb/actiongamebufftable.rs
Normal file
78
data/src/exceldb/actiongamebufftable.rs
Normal file
@@ -0,0 +1,78 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Actiongamebufftable {
|
||||
#[serde(rename = "buffActiveType")]
|
||||
pub buff_active_type: i32,
|
||||
#[serde(rename = "buffApplyType")]
|
||||
pub buff_apply_type: i32,
|
||||
#[serde(rename = "buffDescNameTextId")]
|
||||
pub buff_desc_name_text_id: Option<i32>,
|
||||
#[serde(rename = "buffEffectName")]
|
||||
pub buff_effect_name: Option<String>,
|
||||
#[serde(rename = "buffNameTextId")]
|
||||
pub buff_name_text_id: Option<i32>,
|
||||
#[serde(rename = "buffSpriteName")]
|
||||
pub buff_sprite_name: Option<String>,
|
||||
#[serde(rename = "buffTime")]
|
||||
pub buff_time: f32,
|
||||
#[serde(rename = "buffValue")]
|
||||
pub buff_value: Option<f32>,
|
||||
#[serde(rename = "classType")]
|
||||
pub class_type: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "subMagicValue")]
|
||||
pub sub_magic_value: Option<Vec<f32>>,
|
||||
}
|
||||
|
||||
pub struct ActiongamebufftableTable {
|
||||
records: Vec<Actiongamebufftable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl ActiongamebufftableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Actiongamebufftable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Actiongamebufftable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Actiongamebufftable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Actiongamebufftable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
102
data/src/exceldb/actiongamechartable.rs
Normal file
102
data/src/exceldb/actiongamechartable.rs
Normal file
@@ -0,0 +1,102 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Actiongamechartable {
|
||||
#[serde(rename = "charDescNameTextId")]
|
||||
pub char_desc_name_text_id: i32,
|
||||
#[serde(rename = "charIcon")]
|
||||
pub char_icon: String,
|
||||
#[serde(rename = "charIllustName")]
|
||||
pub char_illust_name: Option<String>,
|
||||
#[serde(rename = "charNameImage")]
|
||||
pub char_name_image: String,
|
||||
#[serde(rename = "charNameTextId")]
|
||||
pub char_name_text_id: i32,
|
||||
#[serde(rename = "charPrefabPath")]
|
||||
pub char_prefab_path: String,
|
||||
#[serde(rename = "charSkillGroupId")]
|
||||
pub char_skill_group_id: i32,
|
||||
#[serde(rename = "charStatId")]
|
||||
pub char_stat_id: i32,
|
||||
#[serde(rename = "charStatImageName")]
|
||||
pub char_stat_image_name: Option<String>,
|
||||
#[serde(rename = "charThumName")]
|
||||
pub char_thum_name: String,
|
||||
#[serde(rename = "charTitleNameTextId")]
|
||||
pub char_title_name_text_id: i32,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "hitEffPrefab")]
|
||||
pub hit_eff_prefab: Option<String>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "monsterPartsGroupId")]
|
||||
pub monster_parts_group_id: Option<i32>,
|
||||
#[serde(rename = "monsterType")]
|
||||
pub monster_type: Option<i32>,
|
||||
#[serde(rename = "voiceResourceName")]
|
||||
pub voice_resource_name: Option<String>,
|
||||
}
|
||||
|
||||
pub struct ActiongamechartableTable {
|
||||
records: Vec<Actiongamechartable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl ActiongamechartableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Actiongamechartable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.char_skill_group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Actiongamechartable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Actiongamechartable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Actiongamechartable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Actiongamechartable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
91
data/src/exceldb/actiongamedefaulttable.rs
Normal file
91
data/src/exceldb/actiongamedefaulttable.rs
Normal file
@@ -0,0 +1,91 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Actiongamedefaulttable {
|
||||
#[serde(rename = "aggroDecreaseValue")]
|
||||
pub aggro_decrease_value: f32,
|
||||
#[serde(rename = "alertStateBuffId")]
|
||||
pub alert_state_buff_id: i32,
|
||||
#[serde(rename = "blowDamageSoundName")]
|
||||
pub blow_damage_sound_name: String,
|
||||
#[serde(rename = "brokenBuffId")]
|
||||
pub broken_buff_id: i32,
|
||||
#[serde(rename = "cutDamageSoundName")]
|
||||
pub cut_damage_sound_name: String,
|
||||
#[serde(rename = "damageLimit")]
|
||||
pub damage_limit: i32,
|
||||
#[serde(rename = "emergencyHpRate")]
|
||||
pub emergency_hp_rate: f32,
|
||||
#[serde(rename = "eventMissionGroupId")]
|
||||
pub event_mission_group_id: i32,
|
||||
#[serde(rename = "healEffectPrefabName")]
|
||||
pub heal_effect_prefab_name: String,
|
||||
#[serde(rename = "justDodgeEffectPrefabName")]
|
||||
pub just_dodge_effect_prefab_name: String,
|
||||
#[serde(rename = "justDodgeInvincibleTime")]
|
||||
pub just_dodge_invincible_time: f32,
|
||||
#[serde(rename = "loadingLimit")]
|
||||
pub loading_limit: i32,
|
||||
#[serde(rename = "outGameBgmName")]
|
||||
pub out_game_bgm_name: String,
|
||||
#[serde(rename = "rageDamageValue")]
|
||||
pub rage_damage_value: f32,
|
||||
#[serde(rename = "rankMaxCount")]
|
||||
pub rank_max_count: i32,
|
||||
#[serde(rename = "skillHoldThreshold")]
|
||||
pub skill_hold_threshold: f32,
|
||||
}
|
||||
|
||||
pub struct ActiongamedefaulttableTable {
|
||||
records: Vec<Actiongamedefaulttable>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl ActiongamedefaulttableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Actiongamedefaulttable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_group.entry(record.event_mission_group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Actiongamedefaulttable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Actiongamedefaulttable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Actiongamedefaulttable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
70
data/src/exceldb/actiongamekeybuttontable.rs
Normal file
70
data/src/exceldb/actiongamekeybuttontable.rs
Normal file
@@ -0,0 +1,70 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Actiongamekeybuttontable {
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "skillButton1")]
|
||||
pub skill_button1: i32,
|
||||
#[serde(rename = "skillButton1Hold")]
|
||||
pub skill_button1_hold: Option<i32>,
|
||||
#[serde(rename = "skillButton2")]
|
||||
pub skill_button2: i32,
|
||||
#[serde(rename = "skillButton3")]
|
||||
pub skill_button3: i32,
|
||||
#[serde(rename = "skillButton4")]
|
||||
pub skill_button4: i32,
|
||||
#[serde(rename = "skillButton5")]
|
||||
pub skill_button5: i32,
|
||||
}
|
||||
|
||||
pub struct ActiongamekeybuttontableTable {
|
||||
records: Vec<Actiongamekeybuttontable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl ActiongamekeybuttontableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Actiongamekeybuttontable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Actiongamekeybuttontable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Actiongamekeybuttontable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Actiongamekeybuttontable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
76
data/src/exceldb/actiongamemissiontable.rs
Normal file
76
data/src/exceldb/actiongamemissiontable.rs
Normal file
@@ -0,0 +1,76 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Actiongamemissiontable {
|
||||
#[serde(rename = "conditionSubType")]
|
||||
pub condition_sub_type: i32,
|
||||
#[serde(rename = "conditionSubTypeParam")]
|
||||
pub condition_sub_type_param: Option<i32>,
|
||||
#[serde(rename = "conditionType")]
|
||||
pub condition_type: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "missionDescNameTextId")]
|
||||
pub mission_desc_name_text_id: i32,
|
||||
#[serde(rename = "missionNameNameTextId")]
|
||||
pub mission_name_name_text_id: i32,
|
||||
#[serde(rename = "monsterType")]
|
||||
pub monster_type: i32,
|
||||
#[serde(rename = "rewardCount")]
|
||||
pub reward_count: Option<i32>,
|
||||
#[serde(rename = "rewardId")]
|
||||
pub reward_id: Option<i32>,
|
||||
#[serde(rename = "rewardType")]
|
||||
pub reward_type: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct ActiongamemissiontableTable {
|
||||
records: Vec<Actiongamemissiontable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl ActiongamemissiontableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Actiongamemissiontable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Actiongamemissiontable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Actiongamemissiontable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Actiongamemissiontable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
90
data/src/exceldb/actiongamemonsterpartstable.rs
Normal file
90
data/src/exceldb/actiongamemonsterpartstable.rs
Normal file
@@ -0,0 +1,90 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Actiongamemonsterpartstable {
|
||||
#[serde(rename = "banMonsterPatternId")]
|
||||
pub ban_monster_pattern_id: Option<Vec<i32>>,
|
||||
#[serde(rename = "baseModelName")]
|
||||
pub base_model_name: Option<String>,
|
||||
#[serde(rename = "blowWeakPartsValue")]
|
||||
pub blow_weak_parts_value: Option<f32>,
|
||||
#[serde(rename = "breakType")]
|
||||
pub break_type: Option<i32>,
|
||||
#[serde(rename = "brokenAnimationName")]
|
||||
pub broken_animation_name: Option<String>,
|
||||
#[serde(rename = "brokenModelName")]
|
||||
pub broken_model_name: Option<String>,
|
||||
#[serde(rename = "brokenValue")]
|
||||
pub broken_value: Option<i32>,
|
||||
#[serde(rename = "cutWeakPartsValue")]
|
||||
pub cut_weak_parts_value: Option<f32>,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "partsNameTextId")]
|
||||
pub parts_name_text_id: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct ActiongamemonsterpartstableTable {
|
||||
records: Vec<Actiongamemonsterpartstable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl ActiongamemonsterpartstableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Actiongamemonsterpartstable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Actiongamemonsterpartstable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Actiongamemonsterpartstable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Actiongamemonsterpartstable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Actiongamemonsterpartstable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
90
data/src/exceldb/actiongamemonsterpatterntable.rs
Normal file
90
data/src/exceldb/actiongamemonsterpatterntable.rs
Normal file
@@ -0,0 +1,90 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Actiongamemonsterpatterntable {
|
||||
#[serde(rename = "attackRangeMin")]
|
||||
pub attack_range_min: Option<f32>,
|
||||
#[serde(rename = "conditionType1")]
|
||||
pub condition_type1: Option<i32>,
|
||||
#[serde(rename = "conditionType2")]
|
||||
pub condition_type2: Option<i32>,
|
||||
#[serde(rename = "conditionValue1")]
|
||||
pub condition_value1: Option<i32>,
|
||||
#[serde(rename = "conditionValue2")]
|
||||
pub condition_value2: Option<i32>,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "maxCount")]
|
||||
pub max_count: Option<i32>,
|
||||
#[serde(rename = "priority")]
|
||||
pub priority: i32,
|
||||
#[serde(rename = "probability")]
|
||||
pub probability: f32,
|
||||
#[serde(rename = "skillId")]
|
||||
pub skill_id: i32,
|
||||
}
|
||||
|
||||
pub struct ActiongamemonsterpatterntableTable {
|
||||
records: Vec<Actiongamemonsterpatterntable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl ActiongamemonsterpatterntableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Actiongamemonsterpatterntable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Actiongamemonsterpatterntable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Actiongamemonsterpatterntable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Actiongamemonsterpatterntable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Actiongamemonsterpatterntable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
100
data/src/exceldb/actiongameskilltable.rs
Normal file
100
data/src/exceldb/actiongameskilltable.rs
Normal file
@@ -0,0 +1,100 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Actiongameskilltable {
|
||||
#[serde(rename = "attackId")]
|
||||
pub attack_id: Option<i32>,
|
||||
#[serde(rename = "buffId")]
|
||||
pub buff_id: Option<Vec<i32>>,
|
||||
#[serde(rename = "comboType")]
|
||||
pub combo_type: Option<i32>,
|
||||
#[serde(rename = "comboValue")]
|
||||
pub combo_value: Option<i32>,
|
||||
#[serde(rename = "cooldown")]
|
||||
pub cooldown: Option<f32>,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "hitSoundName")]
|
||||
pub hit_sound_name: Option<String>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "skillAnimationName")]
|
||||
pub skill_animation_name: Option<String>,
|
||||
#[serde(rename = "skillCancelType")]
|
||||
pub skill_cancel_type: Option<i32>,
|
||||
#[serde(rename = "skillDescNameTextId")]
|
||||
pub skill_desc_name_text_id: Option<i32>,
|
||||
#[serde(rename = "skillIconSpriteName")]
|
||||
pub skill_icon_sprite_name: Option<String>,
|
||||
#[serde(rename = "skillNameTextId")]
|
||||
pub skill_name_text_id: Option<i32>,
|
||||
#[serde(rename = "skillType")]
|
||||
pub skill_type: i32,
|
||||
#[serde(rename = "skillTypeValue")]
|
||||
pub skill_type_value: Vec<f32>,
|
||||
#[serde(rename = "staminaValue")]
|
||||
pub stamina_value: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct ActiongameskilltableTable {
|
||||
records: Vec<Actiongameskilltable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl ActiongameskilltableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Actiongameskilltable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Actiongameskilltable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Actiongameskilltable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Actiongameskilltable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Actiongameskilltable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
92
data/src/exceldb/actiongamestagetable.rs
Normal file
92
data/src/exceldb/actiongamestagetable.rs
Normal file
@@ -0,0 +1,92 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Actiongamestagetable {
|
||||
#[serde(rename = "charMonsterId")]
|
||||
pub char_monster_id: i32,
|
||||
#[serde(rename = "clearTime")]
|
||||
pub clear_time: i32,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "loadingSceneName")]
|
||||
pub loading_scene_name: String,
|
||||
#[serde(rename = "mapSceneName")]
|
||||
pub map_scene_name: String,
|
||||
#[serde(rename = "stageDescLocalTextId")]
|
||||
pub stage_desc_local_text_id: i32,
|
||||
#[serde(rename = "stageDifficulty")]
|
||||
pub stage_difficulty: i32,
|
||||
#[serde(rename = "stageNameLocalTextId")]
|
||||
pub stage_name_local_text_id: i32,
|
||||
#[serde(rename = "stageTitleLocalTextId")]
|
||||
pub stage_title_local_text_id: i32,
|
||||
#[serde(rename = "stageType")]
|
||||
pub stage_type: i32,
|
||||
#[serde(rename = "timeLimit")]
|
||||
pub time_limit: i32,
|
||||
}
|
||||
|
||||
pub struct ActiongamestagetableTable {
|
||||
records: Vec<Actiongamestagetable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl ActiongamestagetableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Actiongamestagetable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Actiongamestagetable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Actiongamestagetable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Actiongamestagetable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Actiongamestagetable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
78
data/src/exceldb/actiongamestattable.rs
Normal file
78
data/src/exceldb/actiongamestattable.rs
Normal file
@@ -0,0 +1,78 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Actiongamestattable {
|
||||
#[serde(rename = "criticalDamageRate")]
|
||||
pub critical_damage_rate: Option<f32>,
|
||||
#[serde(rename = "groggyHealthValue")]
|
||||
pub groggy_health_value: Option<i32>,
|
||||
#[serde(rename = "healthMaxValue")]
|
||||
pub health_max_value: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "moveSpeed")]
|
||||
pub move_speed: f32,
|
||||
#[serde(rename = "powerValue")]
|
||||
pub power_value: f32,
|
||||
#[serde(rename = "rageMaxValue")]
|
||||
pub rage_max_value: Option<i32>,
|
||||
#[serde(rename = "recoveryCount")]
|
||||
pub recovery_count: Option<i32>,
|
||||
#[serde(rename = "specialGaugeMaxValue")]
|
||||
pub special_gauge_max_value: Option<i32>,
|
||||
#[serde(rename = "staminaMaxValue")]
|
||||
pub stamina_max_value: Option<f32>,
|
||||
#[serde(rename = "staminaRecoveryValue")]
|
||||
pub stamina_recovery_value: Option<f32>,
|
||||
}
|
||||
|
||||
pub struct ActiongamestattableTable {
|
||||
records: Vec<Actiongamestattable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl ActiongamestattableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Actiongamestattable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Actiongamestattable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Actiongamestattable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Actiongamestattable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
78
data/src/exceldb/actiongametable.rs
Normal file
78
data/src/exceldb/actiongametable.rs
Normal file
@@ -0,0 +1,78 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Actiongametable {
|
||||
#[serde(rename = "battleStartTimeline")]
|
||||
pub battle_start_timeline: String,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "stageGroupId")]
|
||||
pub stage_group_id: i32,
|
||||
#[serde(rename = "stageMonsterIcon")]
|
||||
pub stage_monster_icon: String,
|
||||
#[serde(rename = "stageThumName")]
|
||||
pub stage_thum_name: String,
|
||||
}
|
||||
|
||||
pub struct ActiongametableTable {
|
||||
records: Vec<Actiongametable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl ActiongametableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Actiongametable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.stage_group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Actiongametable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Actiongametable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Actiongametable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Actiongametable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
62
data/src/exceldb/adventuregroupbufftable.rs
Normal file
62
data/src/exceldb/adventuregroupbufftable.rs
Normal file
@@ -0,0 +1,62 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Adventuregroupbufftable {
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "statType")]
|
||||
pub stat_type: i32,
|
||||
#[serde(rename = "statValue")]
|
||||
pub stat_value: Option<f32>,
|
||||
}
|
||||
|
||||
pub struct AdventuregroupbufftableTable {
|
||||
records: Vec<Adventuregroupbufftable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl AdventuregroupbufftableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Adventuregroupbufftable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Adventuregroupbufftable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Adventuregroupbufftable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Adventuregroupbufftable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
62
data/src/exceldb/alchemypictorialbooktable.rs
Normal file
62
data/src/exceldb/alchemypictorialbooktable.rs
Normal file
@@ -0,0 +1,62 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Alchemypictorialbooktable {
|
||||
#[serde(rename = "category")]
|
||||
pub category: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "itemId")]
|
||||
pub item_id: i32,
|
||||
}
|
||||
|
||||
pub struct AlchemypictorialbooktableTable {
|
||||
records: Vec<Alchemypictorialbooktable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl AlchemypictorialbooktableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Alchemypictorialbooktable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Alchemypictorialbooktable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Alchemypictorialbooktable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Alchemypictorialbooktable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
90
data/src/exceldb/alchemytable.rs
Normal file
90
data/src/exceldb/alchemytable.rs
Normal file
@@ -0,0 +1,90 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Alchemytable {
|
||||
#[serde(rename = "alchemyCategory")]
|
||||
pub alchemy_category: i32,
|
||||
#[serde(rename = "displayGroupId")]
|
||||
pub display_group_id: i32,
|
||||
#[serde(rename = "groupLocalTextId")]
|
||||
pub group_local_text_id: Option<i32>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "materialItemCount")]
|
||||
pub material_item_count: Vec<i32>,
|
||||
#[serde(rename = "materialItemId")]
|
||||
pub material_item_id: Vec<i32>,
|
||||
#[serde(rename = "materialItemType")]
|
||||
pub material_item_type: Vec<i32>,
|
||||
#[serde(rename = "resultItemCount")]
|
||||
pub result_item_count: i32,
|
||||
#[serde(rename = "resultItemId")]
|
||||
pub result_item_id: i32,
|
||||
#[serde(rename = "resultItemType")]
|
||||
pub result_item_type: i32,
|
||||
#[serde(rename = "talentLevel")]
|
||||
pub talent_level: i32,
|
||||
}
|
||||
|
||||
pub struct AlchemytableTable {
|
||||
records: Vec<Alchemytable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl AlchemytableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Alchemytable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.display_group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Alchemytable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Alchemytable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Alchemytable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Alchemytable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
74
data/src/exceldb/attendancealwaysgrouptable.rs
Normal file
74
data/src/exceldb/attendancealwaysgrouptable.rs
Normal file
@@ -0,0 +1,74 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Attendancealwaysgrouptable {
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "nextId")]
|
||||
pub next_id: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct AttendancealwaysgrouptableTable {
|
||||
records: Vec<Attendancealwaysgrouptable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl AttendancealwaysgrouptableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Attendancealwaysgrouptable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Attendancealwaysgrouptable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Attendancealwaysgrouptable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Attendancealwaysgrouptable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Attendancealwaysgrouptable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
80
data/src/exceldb/attendancealwaysrewardtable.rs
Normal file
80
data/src/exceldb/attendancealwaysrewardtable.rs
Normal file
@@ -0,0 +1,80 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Attendancealwaysrewardtable {
|
||||
#[serde(rename = "attendanceCount")]
|
||||
pub attendance_count: i32,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "rewardCount")]
|
||||
pub reward_count: i32,
|
||||
#[serde(rename = "rewardId")]
|
||||
pub reward_id: i32,
|
||||
#[serde(rename = "rewardType")]
|
||||
pub reward_type: i32,
|
||||
}
|
||||
|
||||
pub struct AttendancealwaysrewardtableTable {
|
||||
records: Vec<Attendancealwaysrewardtable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl AttendancealwaysrewardtableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Attendancealwaysrewardtable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Attendancealwaysrewardtable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Attendancealwaysrewardtable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Attendancealwaysrewardtable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Attendancealwaysrewardtable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
74
data/src/exceldb/attendancealwaystable.rs
Normal file
74
data/src/exceldb/attendancealwaystable.rs
Normal file
@@ -0,0 +1,74 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Attendancealwaystable {
|
||||
#[serde(rename = "alwaysGroupId")]
|
||||
pub always_group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "titleLocalTextId")]
|
||||
pub title_local_text_id: String,
|
||||
}
|
||||
|
||||
pub struct AttendancealwaystableTable {
|
||||
records: Vec<Attendancealwaystable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl AttendancealwaystableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Attendancealwaystable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.always_group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Attendancealwaystable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Attendancealwaystable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Attendancealwaystable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Attendancealwaystable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
74
data/src/exceldb/attendancelimitrewardtable.rs
Normal file
74
data/src/exceldb/attendancelimitrewardtable.rs
Normal file
@@ -0,0 +1,74 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Attendancelimitrewardtable {
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "randomBoxId")]
|
||||
pub random_box_id: i32,
|
||||
}
|
||||
|
||||
pub struct AttendancelimitrewardtableTable {
|
||||
records: Vec<Attendancelimitrewardtable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl AttendancelimitrewardtableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Attendancelimitrewardtable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Attendancelimitrewardtable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Attendancelimitrewardtable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Attendancelimitrewardtable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Attendancelimitrewardtable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
78
data/src/exceldb/attendancerewardtable.rs
Normal file
78
data/src/exceldb/attendancerewardtable.rs
Normal file
@@ -0,0 +1,78 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Attendancerewardtable {
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "rewardCount")]
|
||||
pub reward_count: i32,
|
||||
#[serde(rename = "rewardId")]
|
||||
pub reward_id: i32,
|
||||
#[serde(rename = "rewardType")]
|
||||
pub reward_type: i32,
|
||||
}
|
||||
|
||||
pub struct AttendancerewardtableTable {
|
||||
records: Vec<Attendancerewardtable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl AttendancerewardtableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Attendancerewardtable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Attendancerewardtable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Attendancerewardtable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Attendancerewardtable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Attendancerewardtable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
110
data/src/exceldb/battledecktable.rs
Normal file
110
data/src/exceldb/battledecktable.rs
Normal file
@@ -0,0 +1,110 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Battledecktable {
|
||||
#[serde(rename = "battleClearLocalTextId")]
|
||||
pub battle_clear_local_text_id: i32,
|
||||
#[serde(rename = "battleFailLocalTextId")]
|
||||
pub battle_fail_local_text_id: i32,
|
||||
#[serde(rename = "battleFieldBuff")]
|
||||
pub battle_field_buff: Option<Vec<i32>>,
|
||||
#[serde(rename = "bonusPointLocalTextId")]
|
||||
pub bonus_point_local_text_id: Option<Vec<i32>>,
|
||||
#[serde(rename = "bonusPointThumnailLocalTextId")]
|
||||
pub bonus_point_thumnail_local_text_id: Option<Vec<i32>>,
|
||||
#[serde(rename = "bonusPointType")]
|
||||
pub bonus_point_type: Option<Vec<i32>>,
|
||||
#[serde(rename = "bonusPointValue1")]
|
||||
pub bonus_point_value1: Option<Vec<i32>>,
|
||||
#[serde(rename = "bonusPointValue2")]
|
||||
pub bonus_point_value2: Option<Vec<i32>>,
|
||||
#[serde(rename = "bonusRewardCount")]
|
||||
pub bonus_reward_count: Option<Vec<i32>>,
|
||||
#[serde(rename = "bonusRewardId")]
|
||||
pub bonus_reward_id: Option<Vec<i32>>,
|
||||
#[serde(rename = "bonusRewardType")]
|
||||
pub bonus_reward_type: Option<Vec<i32>>,
|
||||
#[serde(rename = "bonusScore")]
|
||||
pub bonus_score: Option<Vec<i32>>,
|
||||
#[serde(rename = "charId")]
|
||||
pub char_id: Vec<i32>,
|
||||
#[serde(rename = "commonSoundId")]
|
||||
pub common_sound_id: i32,
|
||||
#[serde(rename = "costumeId")]
|
||||
pub costume_id: Vec<i32>,
|
||||
#[serde(rename = "costumeId2")]
|
||||
pub costume_id2: Vec<i32>,
|
||||
#[serde(rename = "damageRate")]
|
||||
pub damage_rate: f32,
|
||||
#[serde(rename = "deathTimeStartTurnPvE")]
|
||||
pub death_time_start_turn_pv_e: i32,
|
||||
#[serde(rename = "failWayPointId")]
|
||||
pub fail_way_point_id: i32,
|
||||
#[serde(rename = "healthRate")]
|
||||
pub health_rate: f32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "level")]
|
||||
pub level: Vec<i32>,
|
||||
#[serde(rename = "mapScenePath")]
|
||||
pub map_scene_path: String,
|
||||
#[serde(rename = "position")]
|
||||
pub position: Vec<i32>,
|
||||
#[serde(rename = "sequence")]
|
||||
pub sequence: Vec<i32>,
|
||||
#[serde(rename = "solutionTipTextId")]
|
||||
pub solution_tip_text_id: Option<i32>,
|
||||
#[serde(rename = "useBattleContinue")]
|
||||
pub use_battle_continue: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct BattledecktableTable {
|
||||
records: Vec<Battledecktable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl BattledecktableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Battledecktable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Battledecktable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Battledecktable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Battledecktable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
106
data/src/exceldb/battledefaulttable.rs
Normal file
106
data/src/exceldb/battledefaulttable.rs
Normal file
@@ -0,0 +1,106 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Battledefaulttable {
|
||||
#[serde(rename = "AtkMax")]
|
||||
pub atk_max: i32,
|
||||
#[serde(rename = "CriDMax")]
|
||||
pub cri_d_max: f32,
|
||||
#[serde(rename = "CriMax")]
|
||||
pub cri_max: f32,
|
||||
#[serde(rename = "DefMax")]
|
||||
pub def_max: f32,
|
||||
#[serde(rename = "FieldObjectBattleRearrangeEffectTime")]
|
||||
pub field_object_battle_rearrange_effect_time: i32,
|
||||
#[serde(rename = "FieldObjectBattleRearrangeTime")]
|
||||
pub field_object_battle_rearrange_time: i32,
|
||||
#[serde(rename = "HpMaxLimit")]
|
||||
pub hp_max_limit: i32,
|
||||
#[serde(rename = "SpReductionMax")]
|
||||
pub sp_reduction_max: i32,
|
||||
#[serde(rename = "SpReductionMin")]
|
||||
pub sp_reduction_min: i32,
|
||||
#[serde(rename = "battleContinueCostItemCount")]
|
||||
pub battle_continue_cost_item_count: i32,
|
||||
#[serde(rename = "battleContinueCostItemType")]
|
||||
pub battle_continue_cost_item_type: i32,
|
||||
#[serde(rename = "battleContinueMaxCount")]
|
||||
pub battle_continue_max_count: i32,
|
||||
#[serde(rename = "battlePowerConst")]
|
||||
pub battle_power_const: i32,
|
||||
#[serde(rename = "chainDamageValue")]
|
||||
pub chain_damage_value: f32,
|
||||
#[serde(rename = "chainMaxCount")]
|
||||
pub chain_max_count: i32,
|
||||
#[serde(rename = "deathTimeBuffId")]
|
||||
pub death_time_buff_id: i32,
|
||||
#[serde(rename = "deathTimeStartTurnPvP")]
|
||||
pub death_time_start_turn_pv_p: i32,
|
||||
#[serde(rename = "frontMoveSec")]
|
||||
pub front_move_sec: f32,
|
||||
#[serde(rename = "minAttackDamage")]
|
||||
pub min_attack_damage: i32,
|
||||
#[serde(rename = "sideMoveSec")]
|
||||
pub side_move_sec: f32,
|
||||
#[serde(rename = "spGuildRaidMaxCount")]
|
||||
pub sp_guild_raid_max_count: i32,
|
||||
#[serde(rename = "spMaxCount")]
|
||||
pub sp_max_count: i32,
|
||||
#[serde(rename = "spStartGuildRaidCount")]
|
||||
pub sp_start_guild_raid_count: i32,
|
||||
#[serde(rename = "spStartHunterCount")]
|
||||
pub sp_start_hunter_count: i32,
|
||||
#[serde(rename = "spStartPvECount")]
|
||||
pub sp_start_pv_e_count: i32,
|
||||
#[serde(rename = "spStartPvPBLUECount")]
|
||||
pub sp_start_pv_p_b_l_u_e_count: i32,
|
||||
#[serde(rename = "spStartPvPREDCount")]
|
||||
pub sp_start_pv_p_r_e_d_count: i32,
|
||||
#[serde(rename = "spTurnAddGuildRaidCount")]
|
||||
pub sp_turn_add_guild_raid_count: i32,
|
||||
#[serde(rename = "spTurnAddHunterCount")]
|
||||
pub sp_turn_add_hunter_count: i32,
|
||||
#[serde(rename = "spTurnAddPvPCount")]
|
||||
pub sp_turn_add_pv_p_count: i32,
|
||||
#[serde(rename = "strongElementEffect")]
|
||||
pub strong_element_effect: f32,
|
||||
#[serde(rename = "turnPassSec")]
|
||||
pub turn_pass_sec: f32,
|
||||
}
|
||||
|
||||
pub struct BattledefaulttableTable {
|
||||
records: Vec<Battledefaulttable>,
|
||||
}
|
||||
|
||||
impl BattledefaulttableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Battledefaulttable> = serde_json::from_str(&json)?;
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Battledefaulttable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Battledefaulttable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
62
data/src/exceldb/battlefieldbufftable.rs
Normal file
62
data/src/exceldb/battlefieldbufftable.rs
Normal file
@@ -0,0 +1,62 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Battlefieldbufftable {
|
||||
#[serde(rename = "buffID")]
|
||||
pub buff_i_d: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "teamType")]
|
||||
pub team_type: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct BattlefieldbufftableTable {
|
||||
records: Vec<Battlefieldbufftable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl BattlefieldbufftableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Battlefieldbufftable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Battlefieldbufftable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Battlefieldbufftable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Battlefieldbufftable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
74
data/src/exceldb/battlepowertable.rs
Normal file
74
data/src/exceldb/battlepowertable.rs
Normal file
@@ -0,0 +1,74 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Battlepowertable {
|
||||
#[serde(rename = "awakePower")]
|
||||
pub awake_power: i32,
|
||||
#[serde(rename = "costumeGradePower")]
|
||||
pub costume_grade_power: i32,
|
||||
#[serde(rename = "costumePower")]
|
||||
pub costume_power: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "imprintGradePower")]
|
||||
pub imprint_grade_power: i32,
|
||||
#[serde(rename = "levelValuePower")]
|
||||
pub level_value_power: i32,
|
||||
#[serde(rename = "potentialConnectionNodePower")]
|
||||
pub potential_connection_node_power: i32,
|
||||
#[serde(rename = "potentialPublicNodePower")]
|
||||
pub potential_public_node_power: i32,
|
||||
#[serde(rename = "potentialSkillNodePower")]
|
||||
pub potential_skill_node_power: i32,
|
||||
}
|
||||
|
||||
pub struct BattlepowertableTable {
|
||||
records: Vec<Battlepowertable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl BattlepowertableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Battlepowertable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Battlepowertable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Battlepowertable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Battlepowertable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
80
data/src/exceldb/bingocompleterewardgrouptable.rs
Normal file
80
data/src/exceldb/bingocompleterewardgrouptable.rs
Normal file
@@ -0,0 +1,80 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Bingocompleterewardgrouptable {
|
||||
#[serde(rename = "completeCount")]
|
||||
pub complete_count: i32,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "rewardCount")]
|
||||
pub reward_count: i32,
|
||||
#[serde(rename = "rewardId")]
|
||||
pub reward_id: Option<i32>,
|
||||
#[serde(rename = "rewardType")]
|
||||
pub reward_type: i32,
|
||||
}
|
||||
|
||||
pub struct BingocompleterewardgrouptableTable {
|
||||
records: Vec<Bingocompleterewardgrouptable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl BingocompleterewardgrouptableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Bingocompleterewardgrouptable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Bingocompleterewardgrouptable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Bingocompleterewardgrouptable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Bingocompleterewardgrouptable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Bingocompleterewardgrouptable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
84
data/src/exceldb/bingolinerewardgrouptable.rs
Normal file
84
data/src/exceldb/bingolinerewardgrouptable.rs
Normal file
@@ -0,0 +1,84 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Bingolinerewardgrouptable {
|
||||
#[serde(rename = "clearCount")]
|
||||
pub clear_count: Option<i32>,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "lineIndex")]
|
||||
pub line_index: Option<i32>,
|
||||
#[serde(rename = "lineType")]
|
||||
pub line_type: Option<i32>,
|
||||
#[serde(rename = "rewardCount")]
|
||||
pub reward_count: i32,
|
||||
#[serde(rename = "rewardId")]
|
||||
pub reward_id: Option<i32>,
|
||||
#[serde(rename = "rewardType")]
|
||||
pub reward_type: i32,
|
||||
}
|
||||
|
||||
pub struct BingolinerewardgrouptableTable {
|
||||
records: Vec<Bingolinerewardgrouptable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl BingolinerewardgrouptableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Bingolinerewardgrouptable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Bingolinerewardgrouptable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Bingolinerewardgrouptable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Bingolinerewardgrouptable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Bingolinerewardgrouptable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
80
data/src/exceldb/bingorewardgrouptable.rs
Normal file
80
data/src/exceldb/bingorewardgrouptable.rs
Normal file
@@ -0,0 +1,80 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Bingorewardgrouptable {
|
||||
#[serde(rename = "clearCount")]
|
||||
pub clear_count: Option<i32>,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "rewardCount")]
|
||||
pub reward_count: i32,
|
||||
#[serde(rename = "rewardId")]
|
||||
pub reward_id: Option<i32>,
|
||||
#[serde(rename = "rewardType")]
|
||||
pub reward_type: i32,
|
||||
}
|
||||
|
||||
pub struct BingorewardgrouptableTable {
|
||||
records: Vec<Bingorewardgrouptable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl BingorewardgrouptableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Bingorewardgrouptable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Bingorewardgrouptable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Bingorewardgrouptable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Bingorewardgrouptable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Bingorewardgrouptable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
74
data/src/exceldb/buffconditiontable.rs
Normal file
74
data/src/exceldb/buffconditiontable.rs
Normal file
@@ -0,0 +1,74 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Buffconditiontable {
|
||||
#[serde(rename = "attackType")]
|
||||
pub attack_type: Option<Vec<i32>>,
|
||||
#[serde(rename = "buffGroup")]
|
||||
pub buff_group: Option<Vec<i32>>,
|
||||
#[serde(rename = "chainLess")]
|
||||
pub chain_less: Option<i32>,
|
||||
#[serde(rename = "chainMore")]
|
||||
pub chain_more: Option<i32>,
|
||||
#[serde(rename = "chainMultiple")]
|
||||
pub chain_multiple: Option<i32>,
|
||||
#[serde(rename = "element")]
|
||||
pub element: Option<Vec<i32>>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "mainTarget")]
|
||||
pub main_target: Option<i32>,
|
||||
#[serde(rename = "subTarget")]
|
||||
pub sub_target: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct BuffconditiontableTable {
|
||||
records: Vec<Buffconditiontable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl BuffconditiontableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Buffconditiontable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Buffconditiontable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Buffconditiontable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Buffconditiontable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
66
data/src/exceldb/buffimmunegrouptable.rs
Normal file
66
data/src/exceldb/buffimmunegrouptable.rs
Normal file
@@ -0,0 +1,66 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Buffimmunegrouptable {
|
||||
#[serde(rename = "buffClassType")]
|
||||
pub buff_class_type: Vec<String>,
|
||||
#[serde(rename = "buffGroupType")]
|
||||
pub buff_group_type: Vec<i32>,
|
||||
#[serde(rename = "buffImmuneApplySkillTextId")]
|
||||
pub buff_immune_apply_skill_text_id: Vec<i32>,
|
||||
#[serde(rename = "buffSubType")]
|
||||
pub buff_sub_type: Vec<i32>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
}
|
||||
|
||||
pub struct BuffimmunegrouptableTable {
|
||||
records: Vec<Buffimmunegrouptable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl BuffimmunegrouptableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Buffimmunegrouptable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Buffimmunegrouptable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Buffimmunegrouptable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Buffimmunegrouptable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
106
data/src/exceldb/bufftable.rs
Normal file
106
data/src/exceldb/bufftable.rs
Normal file
@@ -0,0 +1,106 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Bufftable {
|
||||
#[serde(rename = "AddBuffId")]
|
||||
pub add_buff_id: Option<i32>,
|
||||
#[serde(rename = "buffApplyType")]
|
||||
pub buff_apply_type: Option<i32>,
|
||||
#[serde(rename = "buffConditionId")]
|
||||
pub buff_condition_id: Option<i32>,
|
||||
#[serde(rename = "buffCountType")]
|
||||
pub buff_count_type: Option<i32>,
|
||||
#[serde(rename = "buffDescSkillTextId")]
|
||||
pub buff_desc_skill_text_id: Option<i32>,
|
||||
#[serde(rename = "buffDisplayType")]
|
||||
pub buff_display_type: Option<i32>,
|
||||
#[serde(rename = "buffDisplayValue")]
|
||||
pub buff_display_value: Option<i32>,
|
||||
#[serde(rename = "buffGroup")]
|
||||
pub buff_group: Option<i32>,
|
||||
#[serde(rename = "buffIconSpriteName")]
|
||||
pub buff_icon_sprite_name: Option<String>,
|
||||
#[serde(rename = "buffMakerType")]
|
||||
pub buff_maker_type: Option<i32>,
|
||||
#[serde(rename = "buffSkillTextId")]
|
||||
pub buff_skill_text_id: Option<i32>,
|
||||
#[serde(rename = "buffTurn")]
|
||||
pub buff_turn: Option<i32>,
|
||||
#[serde(rename = "buffType")]
|
||||
pub buff_type: Option<i32>,
|
||||
#[serde(rename = "buffValue")]
|
||||
pub buff_value: Option<f32>,
|
||||
#[serde(rename = "classType")]
|
||||
pub class_type: String,
|
||||
#[serde(rename = "conditionAddBuffId")]
|
||||
pub condition_add_buff_id: Option<i32>,
|
||||
#[serde(rename = "effectPrefabName")]
|
||||
pub effect_prefab_name: Option<String>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "magicValue")]
|
||||
pub magic_value: Option<f32>,
|
||||
#[serde(rename = "overLapCount")]
|
||||
pub over_lap_count: Option<i32>,
|
||||
#[serde(rename = "overLapMax")]
|
||||
pub over_lap_max: Option<i32>,
|
||||
#[serde(rename = "ownerType")]
|
||||
pub owner_type: Option<i32>,
|
||||
#[serde(rename = "specialEffectPrefabName")]
|
||||
pub special_effect_prefab_name: Option<String>,
|
||||
#[serde(rename = "statType")]
|
||||
pub stat_type: Option<i32>,
|
||||
#[serde(rename = "subType")]
|
||||
pub sub_type: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct BufftableTable {
|
||||
records: Vec<Bufftable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl BufftableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Bufftable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Bufftable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Bufftable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Bufftable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
82
data/src/exceldb/cafeteriabubbletable.rs
Normal file
82
data/src/exceldb/cafeteriabubbletable.rs
Normal file
@@ -0,0 +1,82 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cafeteriabubbletable {
|
||||
#[serde(rename = "bubbleLocalTextId")]
|
||||
pub bubble_local_text_id: i32,
|
||||
#[serde(rename = "emotion")]
|
||||
pub emotion: Option<i32>,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "npcId")]
|
||||
pub npc_id: Option<i32>,
|
||||
#[serde(rename = "npcType")]
|
||||
pub npc_type: i32,
|
||||
#[serde(rename = "status")]
|
||||
pub status: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct CafeteriabubbletableTable {
|
||||
records: Vec<Cafeteriabubbletable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl CafeteriabubbletableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cafeteriabubbletable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cafeteriabubbletable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Cafeteriabubbletable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cafeteriabubbletable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cafeteriabubbletable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
66
data/src/exceldb/cafeteriacostumetable.rs
Normal file
66
data/src/exceldb/cafeteriacostumetable.rs
Normal file
@@ -0,0 +1,66 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cafeteriacostumetable {
|
||||
#[serde(rename = "costumeId")]
|
||||
pub costume_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "rewardId")]
|
||||
pub reward_id: i32,
|
||||
#[serde(rename = "rewardType")]
|
||||
pub reward_type: i32,
|
||||
#[serde(rename = "rewardValue")]
|
||||
pub reward_value: i32,
|
||||
}
|
||||
|
||||
pub struct CafeteriacostumetableTable {
|
||||
records: Vec<Cafeteriacostumetable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CafeteriacostumetableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cafeteriacostumetable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cafeteriacostumetable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cafeteriacostumetable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cafeteriacostumetable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
96
data/src/exceldb/cafeteriadefaulttable.rs
Normal file
96
data/src/exceldb/cafeteriadefaulttable.rs
Normal file
@@ -0,0 +1,96 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cafeteriadefaulttable {
|
||||
#[serde(rename = "NpcSpawnDistance")]
|
||||
pub npc_spawn_distance: i32,
|
||||
#[serde(rename = "basicInteractionMaxCount")]
|
||||
pub basic_interaction_max_count: i32,
|
||||
#[serde(rename = "basicInteractionTerm")]
|
||||
pub basic_interaction_term: i32,
|
||||
#[serde(rename = "bubbleDuration")]
|
||||
pub bubble_duration: i32,
|
||||
#[serde(rename = "bubbleMaxCount")]
|
||||
pub bubble_max_count: i32,
|
||||
#[serde(rename = "cafeteriaGuideId")]
|
||||
pub cafeteria_guide_id: i32,
|
||||
#[serde(rename = "cafeteriaNoteConditionValue")]
|
||||
pub cafeteria_note_condition_value: i32,
|
||||
#[serde(rename = "dailyShopCurrencyLimit")]
|
||||
pub daily_shop_currency_limit: i32,
|
||||
#[serde(rename = "defaultBasicInterationCount")]
|
||||
pub default_basic_interation_count: i32,
|
||||
#[serde(rename = "defaultUniqueInterationCount")]
|
||||
pub default_unique_interation_count: i32,
|
||||
#[serde(rename = "eventRewardType")]
|
||||
pub event_reward_type: i32,
|
||||
#[serde(rename = "interactionIgonoreTime")]
|
||||
pub interaction_igonore_time: i32,
|
||||
#[serde(rename = "lowMemSpawnCount")]
|
||||
pub low_mem_spawn_count: i32,
|
||||
#[serde(rename = "maxRewardTime")]
|
||||
pub max_reward_time: i32,
|
||||
#[serde(rename = "minRewardTime")]
|
||||
pub min_reward_time: i32,
|
||||
#[serde(rename = "normalMemSpawnCount")]
|
||||
pub normal_mem_spawn_count: i32,
|
||||
#[serde(rename = "noteRewardType")]
|
||||
pub note_reward_type: i32,
|
||||
#[serde(rename = "noteRewardValue")]
|
||||
pub note_reward_value: i32,
|
||||
#[serde(rename = "questNameTextId")]
|
||||
pub quest_name_text_id: i32,
|
||||
#[serde(rename = "questSkipTextId")]
|
||||
pub quest_skip_text_id: i32,
|
||||
#[serde(rename = "startTimelineName")]
|
||||
pub start_timeline_name: String,
|
||||
#[serde(rename = "startVisualNovelDialogId")]
|
||||
pub start_visual_novel_dialog_id: i32,
|
||||
#[serde(rename = "uniqueInteractionMaxCount")]
|
||||
pub unique_interaction_max_count: i32,
|
||||
#[serde(rename = "uniqueInteractionTerm")]
|
||||
pub unique_interaction_term: i32,
|
||||
#[serde(rename = "visualNovelEndRewardCount")]
|
||||
pub visual_novel_end_reward_count: i32,
|
||||
#[serde(rename = "visualNovelEndRewardId")]
|
||||
pub visual_novel_end_reward_id: i32,
|
||||
#[serde(rename = "visualNovelEndRewardType")]
|
||||
pub visual_novel_end_reward_type: i32,
|
||||
}
|
||||
|
||||
pub struct CafeteriadefaulttableTable {
|
||||
records: Vec<Cafeteriadefaulttable>,
|
||||
}
|
||||
|
||||
impl CafeteriadefaulttableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cafeteriadefaulttable> = serde_json::from_str(&json)?;
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cafeteriadefaulttable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cafeteriadefaulttable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
86
data/src/exceldb/cafeteriaeventtable.rs
Normal file
86
data/src/exceldb/cafeteriaeventtable.rs
Normal file
@@ -0,0 +1,86 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cafeteriaeventtable {
|
||||
#[serde(rename = "TimelineName")]
|
||||
pub timeline_name: Option<String>,
|
||||
#[serde(rename = "bubbleIconSprite")]
|
||||
pub bubble_icon_sprite: String,
|
||||
#[serde(rename = "eventType")]
|
||||
pub event_type: i32,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "reactionPrefabName")]
|
||||
pub reaction_prefab_name: Option<Vec<String>>,
|
||||
#[serde(rename = "reactionTime")]
|
||||
pub reaction_time: Option<Vec<i32>>,
|
||||
#[serde(rename = "rewardCount")]
|
||||
pub reward_count: i32,
|
||||
#[serde(rename = "rewardType")]
|
||||
pub reward_type: i32,
|
||||
}
|
||||
|
||||
pub struct CafeteriaeventtableTable {
|
||||
records: Vec<Cafeteriaeventtable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl CafeteriaeventtableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cafeteriaeventtable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cafeteriaeventtable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Cafeteriaeventtable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cafeteriaeventtable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cafeteriaeventtable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
62
data/src/exceldb/cafeteriafacilitytable.rs
Normal file
62
data/src/exceldb/cafeteriafacilitytable.rs
Normal file
@@ -0,0 +1,62 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cafeteriafacilitytable {
|
||||
#[serde(rename = "facilityType")]
|
||||
pub facility_type: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "objectName")]
|
||||
pub object_name: String,
|
||||
}
|
||||
|
||||
pub struct CafeteriafacilitytableTable {
|
||||
records: Vec<Cafeteriafacilitytable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CafeteriafacilitytableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cafeteriafacilitytable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cafeteriafacilitytable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cafeteriafacilitytable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cafeteriafacilitytable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
80
data/src/exceldb/cafeterialeveltable.rs
Normal file
80
data/src/exceldb/cafeterialeveltable.rs
Normal file
@@ -0,0 +1,80 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cafeterialeveltable {
|
||||
#[serde(rename = "bubbleCooldown")]
|
||||
pub bubble_cooldown: i32,
|
||||
#[serde(rename = "cafeteriaCostumeMax")]
|
||||
pub cafeteria_costume_max: i32,
|
||||
#[serde(rename = "cafeteriaCustomerNpcSpawnCount")]
|
||||
pub cafeteria_customer_npc_spawn_count: i32,
|
||||
#[serde(rename = "dayFxSoundResourceName")]
|
||||
pub day_fx_sound_resource_name: String,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "mapGrade")]
|
||||
pub map_grade: i32,
|
||||
#[serde(rename = "nightFxSoundResourceName")]
|
||||
pub night_fx_sound_resource_name: String,
|
||||
#[serde(rename = "skillType")]
|
||||
pub skill_type: Vec<i32>,
|
||||
#[serde(rename = "skillValue1")]
|
||||
pub skill_value1: Vec<i32>,
|
||||
#[serde(rename = "skillValue2")]
|
||||
pub skill_value2: Vec<i32>,
|
||||
#[serde(rename = "skillValue3")]
|
||||
pub skill_value3: Vec<i32>,
|
||||
#[serde(rename = "skillValue4")]
|
||||
pub skill_value4: Vec<i32>,
|
||||
}
|
||||
|
||||
pub struct CafeterialeveltableTable {
|
||||
records: Vec<Cafeterialeveltable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CafeterialeveltableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cafeterialeveltable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cafeterialeveltable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cafeterialeveltable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cafeterialeveltable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
86
data/src/exceldb/cafeteriamanagetable.rs
Normal file
86
data/src/exceldb/cafeteriamanagetable.rs
Normal file
@@ -0,0 +1,86 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cafeteriamanagetable {
|
||||
#[serde(rename = "costType")]
|
||||
pub cost_type: i32,
|
||||
#[serde(rename = "costValue")]
|
||||
pub cost_value: Option<i32>,
|
||||
#[serde(rename = "facilityId")]
|
||||
pub facility_id: Option<i32>,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: Option<i32>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "manageIconResourceName")]
|
||||
pub manage_icon_resource_name: String,
|
||||
#[serde(rename = "manageLocalTextId")]
|
||||
pub manage_local_text_id: i32,
|
||||
#[serde(rename = "parttimeId")]
|
||||
pub parttime_id: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct CafeteriamanagetableTable {
|
||||
records: Vec<Cafeteriamanagetable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl CafeteriamanagetableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cafeteriamanagetable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
if let Some(group_id) = record.group_id {
|
||||
by_group.entry(group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cafeteriamanagetable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Cafeteriamanagetable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cafeteriamanagetable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cafeteriamanagetable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
60
data/src/exceldb/cafeteriamaptable.rs
Normal file
60
data/src/exceldb/cafeteriamaptable.rs
Normal file
@@ -0,0 +1,60 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cafeteriamaptable {
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "pointPositionId")]
|
||||
pub point_position_id: i32,
|
||||
}
|
||||
|
||||
pub struct CafeteriamaptableTable {
|
||||
records: Vec<Cafeteriamaptable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CafeteriamaptableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cafeteriamaptable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cafeteriamaptable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cafeteriamaptable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cafeteriamaptable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
76
data/src/exceldb/cafeteriamovepatterntable.rs
Normal file
76
data/src/exceldb/cafeteriamovepatterntable.rs
Normal file
@@ -0,0 +1,76 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cafeteriamovepatterntable {
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "movePatternRepeat")]
|
||||
pub move_pattern_repeat: i32,
|
||||
#[serde(rename = "stopTime")]
|
||||
pub stop_time: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct CafeteriamovepatterntableTable {
|
||||
records: Vec<Cafeteriamovepatterntable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl CafeteriamovepatterntableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cafeteriamovepatterntable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cafeteriamovepatterntable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Cafeteriamovepatterntable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cafeteriamovepatterntable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cafeteriamovepatterntable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
88
data/src/exceldb/cafeterianpctable.rs
Normal file
88
data/src/exceldb/cafeterianpctable.rs
Normal file
@@ -0,0 +1,88 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cafeterianpctable {
|
||||
#[serde(rename = "gender")]
|
||||
pub gender: Option<i32>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "movePatternGroupId")]
|
||||
pub move_pattern_group_id: Option<i32>,
|
||||
#[serde(rename = "npcNameTextId")]
|
||||
pub npc_name_text_id: Option<i32>,
|
||||
#[serde(rename = "parttimePrefabName")]
|
||||
pub parttime_prefab_name: String,
|
||||
#[serde(rename = "parttimeType")]
|
||||
pub parttime_type: i32,
|
||||
#[serde(rename = "rewardCount")]
|
||||
pub reward_count: Option<i32>,
|
||||
#[serde(rename = "rewardId")]
|
||||
pub reward_id: Option<i32>,
|
||||
#[serde(rename = "rewardType")]
|
||||
pub reward_type: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct CafeterianpctableTable {
|
||||
records: Vec<Cafeterianpctable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl CafeterianpctableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cafeterianpctable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
if let Some(group_id) = record.move_pattern_group_id {
|
||||
by_group.entry(group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cafeterianpctable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Cafeterianpctable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cafeterianpctable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cafeterianpctable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
66
data/src/exceldb/cafeteriatimetable.rs
Normal file
66
data/src/exceldb/cafeteriatimetable.rs
Normal file
@@ -0,0 +1,66 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cafeteriatimetable {
|
||||
#[serde(rename = "BgmParameter")]
|
||||
pub bgm_parameter: Option<i32>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "lightParameter")]
|
||||
pub light_parameter: Option<i32>,
|
||||
#[serde(rename = "spawnTime")]
|
||||
pub spawn_time: i32,
|
||||
#[serde(rename = "startTime")]
|
||||
pub start_time: String,
|
||||
}
|
||||
|
||||
pub struct CafeteriatimetableTable {
|
||||
records: Vec<Cafeteriatimetable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CafeteriatimetableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cafeteriatimetable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cafeteriatimetable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cafeteriatimetable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cafeteriatimetable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
66
data/src/exceldb/cafeteriauniquenpcspawntable.rs
Normal file
66
data/src/exceldb/cafeteriauniquenpcspawntable.rs
Normal file
@@ -0,0 +1,66 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cafeteriauniquenpcspawntable {
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "occurrenceRatio")]
|
||||
pub occurrence_ratio: Vec<i32>,
|
||||
#[serde(rename = "spawnMaxTime")]
|
||||
pub spawn_max_time: i32,
|
||||
#[serde(rename = "spawnMinTime")]
|
||||
pub spawn_min_time: i32,
|
||||
#[serde(rename = "spawnNpcId")]
|
||||
pub spawn_npc_id: Vec<i32>,
|
||||
}
|
||||
|
||||
pub struct CafeteriauniquenpcspawntableTable {
|
||||
records: Vec<Cafeteriauniquenpcspawntable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CafeteriauniquenpcspawntableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cafeteriauniquenpcspawntable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cafeteriauniquenpcspawntable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cafeteriauniquenpcspawntable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cafeteriauniquenpcspawntable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
100
data/src/exceldb/cashpackagetable.rs
Normal file
100
data/src/exceldb/cashpackagetable.rs
Normal file
@@ -0,0 +1,100 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cashpackagetable {
|
||||
#[serde(rename = "badgeResourceName")]
|
||||
pub badge_resource_name: Option<String>,
|
||||
#[serde(rename = "bannerFontLocalTextId")]
|
||||
pub banner_font_local_text_id: Option<i32>,
|
||||
#[serde(rename = "categoryResourceName")]
|
||||
pub category_resource_name: Option<String>,
|
||||
#[serde(rename = "contentsGroupId")]
|
||||
pub contents_group_id: Option<i32>,
|
||||
#[serde(rename = "contentsLocalTextId")]
|
||||
pub contents_local_text_id: Option<i32>,
|
||||
#[serde(rename = "contentsResourceName")]
|
||||
pub contents_resource_name: Option<String>,
|
||||
#[serde(rename = "contentsSortId")]
|
||||
pub contents_sort_id: Option<i32>,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "isActiveOnEnter")]
|
||||
pub is_active_on_enter: Option<i32>,
|
||||
#[serde(rename = "packageType")]
|
||||
pub package_type: Option<i32>,
|
||||
#[serde(rename = "paidShopGroupId")]
|
||||
pub paid_shop_group_id: i32,
|
||||
#[serde(rename = "paidShopId")]
|
||||
pub paid_shop_id: i32,
|
||||
#[serde(rename = "priority")]
|
||||
pub priority: Option<i32>,
|
||||
#[serde(rename = "resourceName")]
|
||||
pub resource_name: Option<String>,
|
||||
#[serde(rename = "saleGroup")]
|
||||
pub sale_group: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct CashpackagetableTable {
|
||||
records: Vec<Cashpackagetable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl CashpackagetableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cashpackagetable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cashpackagetable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Cashpackagetable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cashpackagetable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cashpackagetable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
96
data/src/exceldb/cashproducttable.rs
Normal file
96
data/src/exceldb/cashproducttable.rs
Normal file
@@ -0,0 +1,96 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cashproducttable {
|
||||
#[serde(rename = "appleInAppId")]
|
||||
pub apple_in_app_id: Option<String>,
|
||||
#[serde(rename = "googleInAppId")]
|
||||
pub google_in_app_id: Option<String>,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "priceCount")]
|
||||
pub price_count: Option<i32>,
|
||||
#[serde(rename = "priceId")]
|
||||
pub price_id: Option<i32>,
|
||||
#[serde(rename = "priceType")]
|
||||
pub price_type: Option<i32>,
|
||||
#[serde(rename = "priority")]
|
||||
pub priority: Option<i32>,
|
||||
#[serde(rename = "productLocalTextId")]
|
||||
pub product_local_text_id: i32,
|
||||
#[serde(rename = "purchaseLimitCount")]
|
||||
pub purchase_limit_count: Option<i32>,
|
||||
#[serde(rename = "purchaseLimitType")]
|
||||
pub purchase_limit_type: Option<i32>,
|
||||
#[serde(rename = "randomboxId")]
|
||||
pub randombox_id: i32,
|
||||
#[serde(rename = "saleGroup")]
|
||||
pub sale_group: Option<i32>,
|
||||
#[serde(rename = "timeLimitType")]
|
||||
pub time_limit_type: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct CashproducttableTable {
|
||||
records: Vec<Cashproducttable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl CashproducttableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cashproducttable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cashproducttable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Cashproducttable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cashproducttable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cashproducttable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
86
data/src/exceldb/cashshoptable.rs
Normal file
86
data/src/exceldb/cashshoptable.rs
Normal file
@@ -0,0 +1,86 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cashshoptable {
|
||||
#[serde(rename = "bgImageName")]
|
||||
pub bg_image_name: Option<String>,
|
||||
#[serde(rename = "dialogueLocalTextId")]
|
||||
pub dialogue_local_text_id: Option<i32>,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "illustName")]
|
||||
pub illust_name: String,
|
||||
#[serde(rename = "priceId")]
|
||||
pub price_id: Vec<i32>,
|
||||
#[serde(rename = "priceType")]
|
||||
pub price_type: Vec<i32>,
|
||||
#[serde(rename = "priority")]
|
||||
pub priority: i32,
|
||||
#[serde(rename = "productGroupId")]
|
||||
pub product_group_id: i32,
|
||||
}
|
||||
|
||||
pub struct CashshoptableTable {
|
||||
records: Vec<Cashshoptable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl CashshoptableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cashshoptable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cashshoptable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Cashshoptable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cashshoptable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cashshoptable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
76
data/src/exceldb/changemissiontable.rs
Normal file
76
data/src/exceldb/changemissiontable.rs
Normal file
@@ -0,0 +1,76 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Changemissiontable {
|
||||
#[serde(rename = "endDate")]
|
||||
pub end_date: String,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "startDate")]
|
||||
pub start_date: String,
|
||||
}
|
||||
|
||||
pub struct ChangemissiontableTable {
|
||||
records: Vec<Changemissiontable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl ChangemissiontableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Changemissiontable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Changemissiontable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Changemissiontable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Changemissiontable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Changemissiontable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
80
data/src/exceldb/characterpictorialbooktable.rs
Normal file
80
data/src/exceldb/characterpictorialbooktable.rs
Normal file
@@ -0,0 +1,80 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Characterpictorialbooktable {
|
||||
#[serde(rename = "charId")]
|
||||
pub char_id: Vec<i32>,
|
||||
#[serde(rename = "collectionBuffId")]
|
||||
pub collection_buff_id: i32,
|
||||
#[serde(rename = "groupDescLocalTextId")]
|
||||
pub group_desc_local_text_id: i32,
|
||||
#[serde(rename = "groupLocalTextId")]
|
||||
pub group_local_text_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "tabType")]
|
||||
pub tab_type: i32,
|
||||
}
|
||||
|
||||
pub struct CharacterpictorialbooktableTable {
|
||||
records: Vec<Characterpictorialbooktable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl CharacterpictorialbooktableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Characterpictorialbooktable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_desc_local_text_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Characterpictorialbooktable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Characterpictorialbooktable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Characterpictorialbooktable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Characterpictorialbooktable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
64
data/src/exceldb/characterquickuitable.rs
Normal file
64
data/src/exceldb/characterquickuitable.rs
Normal file
@@ -0,0 +1,64 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Characterquickuitable {
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "quickUi")]
|
||||
pub quick_ui: i32,
|
||||
#[serde(rename = "quickUiLocalTextId")]
|
||||
pub quick_ui_local_text_id: i32,
|
||||
#[serde(rename = "quickUiSpriteName")]
|
||||
pub quick_ui_sprite_name: String,
|
||||
}
|
||||
|
||||
pub struct CharacterquickuitableTable {
|
||||
records: Vec<Characterquickuitable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CharacterquickuitableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Characterquickuitable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Characterquickuitable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Characterquickuitable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Characterquickuitable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
68
data/src/exceldb/charawakegrowthtable.rs
Normal file
68
data/src/exceldb/charawakegrowthtable.rs
Normal file
@@ -0,0 +1,68 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Charawakegrowthtable {
|
||||
#[serde(rename = "growthItemCount")]
|
||||
pub growth_item_count: Option<Vec<i32>>,
|
||||
#[serde(rename = "growthItemId")]
|
||||
pub growth_item_id: Option<Vec<i32>>,
|
||||
#[serde(rename = "growthItemType")]
|
||||
pub growth_item_type: Option<Vec<i32>>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "statType")]
|
||||
pub stat_type: i32,
|
||||
#[serde(rename = "statValue")]
|
||||
pub stat_value: f32,
|
||||
}
|
||||
|
||||
pub struct CharawakegrowthtableTable {
|
||||
records: Vec<Charawakegrowthtable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CharawakegrowthtableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Charawakegrowthtable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Charawakegrowthtable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Charawakegrowthtable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Charawakegrowthtable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
68
data/src/exceldb/charawaketable.rs
Normal file
68
data/src/exceldb/charawaketable.rs
Normal file
@@ -0,0 +1,68 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Charawaketable {
|
||||
#[serde(rename = "active")]
|
||||
pub active: i32,
|
||||
#[serde(rename = "growthId")]
|
||||
pub growth_id: Vec<i32>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "imprintSlot1")]
|
||||
pub imprint_slot1: i32,
|
||||
#[serde(rename = "imprintSlot2")]
|
||||
pub imprint_slot2: i32,
|
||||
#[serde(rename = "imprintSlot3")]
|
||||
pub imprint_slot3: i32,
|
||||
}
|
||||
|
||||
pub struct CharawaketableTable {
|
||||
records: Vec<Charawaketable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CharawaketableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Charawaketable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Charawaketable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Charawaketable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Charawaketable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
64
data/src/exceldb/charfieldvoicetable.rs
Normal file
64
data/src/exceldb/charfieldvoicetable.rs
Normal file
@@ -0,0 +1,64 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Charfieldvoicetable {
|
||||
#[serde(rename = "damageVoiceName")]
|
||||
pub damage_voice_name: Option<String>,
|
||||
#[serde(rename = "dashVoiceName")]
|
||||
pub dash_voice_name: Option<String>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "liftVoiceName")]
|
||||
pub lift_voice_name: Option<String>,
|
||||
}
|
||||
|
||||
pub struct CharfieldvoicetableTable {
|
||||
records: Vec<Charfieldvoicetable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CharfieldvoicetableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Charfieldvoicetable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Charfieldvoicetable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Charfieldvoicetable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Charfieldvoicetable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
76
data/src/exceldb/chargrouptable.rs
Normal file
76
data/src/exceldb/chargrouptable.rs
Normal file
@@ -0,0 +1,76 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Chargrouptable {
|
||||
#[serde(rename = "charId")]
|
||||
pub char_id: i32,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "level")]
|
||||
pub level: i32,
|
||||
}
|
||||
|
||||
pub struct ChargrouptableTable {
|
||||
records: Vec<Chargrouptable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl ChargrouptableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Chargrouptable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Chargrouptable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Chargrouptable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Chargrouptable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Chargrouptable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
80
data/src/exceldb/chargrowthtable.rs
Normal file
80
data/src/exceldb/chargrowthtable.rs
Normal file
@@ -0,0 +1,80 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Chargrowthtable {
|
||||
#[serde(rename = "charLevelGroupId")]
|
||||
pub char_level_group_id: i32,
|
||||
#[serde(rename = "classupItemCount")]
|
||||
pub classup_item_count: Option<Vec<i32>>,
|
||||
#[serde(rename = "classupItemId")]
|
||||
pub classup_item_id: Option<Vec<i32>>,
|
||||
#[serde(rename = "classupItemType")]
|
||||
pub classup_item_type: Option<Vec<i32>>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "maxLevel")]
|
||||
pub max_level: i32,
|
||||
}
|
||||
|
||||
pub struct ChargrowthtableTable {
|
||||
records: Vec<Chargrowthtable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl ChargrowthtableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Chargrowthtable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.char_level_group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Chargrowthtable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Chargrowthtable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Chargrowthtable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Chargrowthtable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
60
data/src/exceldb/charimprinttable.rs
Normal file
60
data/src/exceldb/charimprinttable.rs
Normal file
@@ -0,0 +1,60 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Charimprinttable {
|
||||
#[serde(rename = "growthId")]
|
||||
pub growth_id: Vec<i32>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
}
|
||||
|
||||
pub struct CharimprinttableTable {
|
||||
records: Vec<Charimprinttable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CharimprinttableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Charimprinttable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Charimprinttable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Charimprinttable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Charimprinttable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
80
data/src/exceldb/charleveltable.rs
Normal file
80
data/src/exceldb/charleveltable.rs
Normal file
@@ -0,0 +1,80 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Charleveltable {
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "health")]
|
||||
pub health: Option<f32>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "levelupExp")]
|
||||
pub levelup_exp: Option<i32>,
|
||||
#[serde(rename = "magicPower")]
|
||||
pub magic_power: Option<f32>,
|
||||
#[serde(rename = "physicalPower")]
|
||||
pub physical_power: Option<f32>,
|
||||
}
|
||||
|
||||
pub struct CharleveltableTable {
|
||||
records: Vec<Charleveltable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl CharleveltableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Charleveltable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Charleveltable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Charleveltable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Charleveltable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Charleveltable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
42
data/src/exceldb/charlisttable.rs
Normal file
42
data/src/exceldb/charlisttable.rs
Normal file
@@ -0,0 +1,42 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Charlisttable {}
|
||||
|
||||
|
||||
pub struct CharlisttableTable {
|
||||
records: Vec<Charlisttable>,
|
||||
}
|
||||
|
||||
impl CharlisttableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Charlisttable> = serde_json::from_str(&json)?;
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Charlisttable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Charlisttable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
66
data/src/exceldb/charrecoverytable.rs
Normal file
66
data/src/exceldb/charrecoverytable.rs
Normal file
@@ -0,0 +1,66 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Charrecoverytable {
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "recoveryAddItemCount")]
|
||||
pub recovery_add_item_count: i32,
|
||||
#[serde(rename = "recoveryItemCount")]
|
||||
pub recovery_item_count: i32,
|
||||
#[serde(rename = "recoveryItemType")]
|
||||
pub recovery_item_type: i32,
|
||||
#[serde(rename = "recoverySquadLevel")]
|
||||
pub recovery_squad_level: i32,
|
||||
}
|
||||
|
||||
pub struct CharrecoverytableTable {
|
||||
records: Vec<Charrecoverytable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CharrecoverytableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Charrecoverytable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Charrecoverytable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Charrecoverytable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Charrecoverytable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
98
data/src/exceldb/chartable.rs
Normal file
98
data/src/exceldb/chartable.rs
Normal file
@@ -0,0 +1,98 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Chartable {
|
||||
#[serde(rename = "charGrowthId")]
|
||||
pub char_growth_id: i32,
|
||||
#[serde(rename = "charNameTextId")]
|
||||
pub char_name_text_id: i32,
|
||||
#[serde(rename = "criticalChanceValue")]
|
||||
pub critical_chance_value: Option<f32>,
|
||||
#[serde(rename = "criticalDamageRateValue")]
|
||||
pub critical_damage_rate_value: Option<f32>,
|
||||
#[serde(rename = "defaultCostumeId")]
|
||||
pub default_costume_id: i32,
|
||||
#[serde(rename = "element")]
|
||||
pub element: Option<i32>,
|
||||
#[serde(rename = "elementDefenseValue")]
|
||||
pub element_defense_value: Option<f32>,
|
||||
#[serde(rename = "elementPowerValue")]
|
||||
pub element_power_value: Option<f32>,
|
||||
#[serde(rename = "grade")]
|
||||
pub grade: i32,
|
||||
#[serde(rename = "growthgrade")]
|
||||
pub growthgrade: i32,
|
||||
#[serde(rename = "healthValue")]
|
||||
pub health_value: f32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "magicDefenseValue")]
|
||||
pub magic_defense_value: Option<f32>,
|
||||
#[serde(rename = "magicPowerValue")]
|
||||
pub magic_power_value: Option<f32>,
|
||||
#[serde(rename = "nextCharId")]
|
||||
pub next_char_id: Option<i32>,
|
||||
#[serde(rename = "physicalDefenseValue")]
|
||||
pub physical_defense_value: Option<f32>,
|
||||
#[serde(rename = "physicalPowerValue")]
|
||||
pub physical_power_value: Option<f32>,
|
||||
#[serde(rename = "talentId")]
|
||||
pub talent_id: Option<i32>,
|
||||
#[serde(rename = "type")]
|
||||
pub r#type: Option<i32>,
|
||||
#[serde(rename = "uniqueCharId")]
|
||||
pub unique_char_id: i32,
|
||||
#[serde(rename = "usePackTemporary")]
|
||||
pub use_pack_temporary: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct ChartableTable {
|
||||
records: Vec<Chartable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl ChartableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Chartable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Chartable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Chartable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Chartable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
62
data/src/exceldb/chatresourcetable.rs
Normal file
62
data/src/exceldb/chatresourcetable.rs
Normal file
@@ -0,0 +1,62 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Chatresourcetable {
|
||||
#[serde(rename = "chatResourceType")]
|
||||
pub chat_resource_type: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "resourceName")]
|
||||
pub resource_name: String,
|
||||
}
|
||||
|
||||
pub struct ChatresourcetableTable {
|
||||
records: Vec<Chatresourcetable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl ChatresourcetableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Chatresourcetable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Chatresourcetable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Chatresourcetable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Chatresourcetable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
106
data/src/exceldb/cinematalktable.rs
Normal file
106
data/src/exceldb/cinematalktable.rs
Normal file
@@ -0,0 +1,106 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cinematalktable {
|
||||
#[serde(rename = "acceptTimeline")]
|
||||
pub accept_timeline: Option<i32>,
|
||||
#[serde(rename = "backgroundImgName")]
|
||||
pub background_img_name: Option<String>,
|
||||
#[serde(rename = "bubbleType")]
|
||||
pub bubble_type: Option<i32>,
|
||||
#[serde(rename = "dialogStoryTextId")]
|
||||
pub dialog_story_text_id: Option<i32>,
|
||||
#[serde(rename = "emotionType")]
|
||||
pub emotion_type: Option<i32>,
|
||||
#[serde(rename = "faceIllustName")]
|
||||
pub face_illust_name: Option<String>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "illustCharAnimation")]
|
||||
pub illust_char_animation: Option<Vec<String>>,
|
||||
#[serde(rename = "illustUniqueCharId")]
|
||||
pub illust_unique_char_id: Option<Vec<i32>>,
|
||||
#[serde(rename = "nameTextId")]
|
||||
pub name_text_id: Option<i32>,
|
||||
#[serde(rename = "packId")]
|
||||
pub pack_id: Option<i32>,
|
||||
#[serde(rename = "packIndex")]
|
||||
pub pack_index: Option<String>,
|
||||
#[serde(rename = "questGroupId")]
|
||||
pub quest_group_id: Option<i32>,
|
||||
#[serde(rename = "questGroupIndex")]
|
||||
pub quest_group_index: Option<i32>,
|
||||
#[serde(rename = "speakerName")]
|
||||
pub speaker_name: Option<String>,
|
||||
#[serde(rename = "state")]
|
||||
pub state: Option<i32>,
|
||||
#[serde(rename = "tabType")]
|
||||
pub tab_type: Option<i32>,
|
||||
#[serde(rename = "voiceResourceName")]
|
||||
pub voice_resource_name: Option<String>,
|
||||
}
|
||||
|
||||
pub struct CinematalktableTable {
|
||||
records: Vec<Cinematalktable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl CinematalktableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cinematalktable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
if let Some(group_id) = record.quest_group_id {
|
||||
by_group.entry(group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cinematalktable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Cinematalktable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cinematalktable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cinematalktable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
42
data/src/exceldb/cleardatatable.rs
Normal file
42
data/src/exceldb/cleardatatable.rs
Normal file
@@ -0,0 +1,42 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cleardatatable {}
|
||||
|
||||
|
||||
pub struct CleardatatableTable {
|
||||
records: Vec<Cleardatatable>,
|
||||
}
|
||||
|
||||
impl CleardatatableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cleardatatable> = serde_json::from_str(&json)?;
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cleardatatable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cleardatatable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
71
data/src/exceldb/clearevilcastletable.rs
Normal file
71
data/src/exceldb/clearevilcastletable.rs
Normal file
@@ -0,0 +1,71 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Clearevilcastletable {
|
||||
#[serde(rename = "contentsTicketId")]
|
||||
pub contents_ticket_id: i32,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "rewardRandomBoxId")]
|
||||
pub reward_random_box_id: i32,
|
||||
#[serde(rename = "towerMagicId")]
|
||||
pub tower_magic_id: i32,
|
||||
#[serde(rename = "towerType")]
|
||||
pub tower_type: i32,
|
||||
#[serde(rename = "type")]
|
||||
pub r#type: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct ClearevilcastletableTable {
|
||||
records: Vec<Clearevilcastletable>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl ClearevilcastletableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Clearevilcastletable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Clearevilcastletable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Clearevilcastletable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Clearevilcastletable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
71
data/src/exceldb/clearpacktable.rs
Normal file
71
data/src/exceldb/clearpacktable.rs
Normal file
@@ -0,0 +1,71 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Clearpacktable {
|
||||
#[serde(rename = "contentsTicketId")]
|
||||
pub contents_ticket_id: i32,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "packId")]
|
||||
pub pack_id: i32,
|
||||
#[serde(rename = "packLevel")]
|
||||
pub pack_level: Option<i32>,
|
||||
#[serde(rename = "rewardRandomBoxId")]
|
||||
pub reward_random_box_id: i32,
|
||||
#[serde(rename = "type")]
|
||||
pub r#type: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct ClearpacktableTable {
|
||||
records: Vec<Clearpacktable>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl ClearpacktableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Clearpacktable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Clearpacktable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Clearpacktable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Clearpacktable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
60
data/src/exceldb/collabotable.rs
Normal file
60
data/src/exceldb/collabotable.rs
Normal file
@@ -0,0 +1,60 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Collabotable {
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "nameTextId")]
|
||||
pub name_text_id: String,
|
||||
}
|
||||
|
||||
pub struct CollabotableTable {
|
||||
records: Vec<Collabotable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CollabotableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Collabotable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Collabotable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Collabotable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Collabotable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
70
data/src/exceldb/collectiontable.rs
Normal file
70
data/src/exceldb/collectiontable.rs
Normal file
@@ -0,0 +1,70 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Collectiontable {
|
||||
#[serde(rename = "grade")]
|
||||
pub grade: i32,
|
||||
#[serde(rename = "iconSpriteName")]
|
||||
pub icon_sprite_name: String,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "itemDescNameTextId")]
|
||||
pub item_desc_name_text_id: i32,
|
||||
#[serde(rename = "itemNameTextId")]
|
||||
pub item_name_text_id: i32,
|
||||
#[serde(rename = "itemSubNameTextId")]
|
||||
pub item_sub_name_text_id: i32,
|
||||
#[serde(rename = "notTrash")]
|
||||
pub not_trash: i32,
|
||||
}
|
||||
|
||||
pub struct CollectiontableTable {
|
||||
records: Vec<Collectiontable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CollectiontableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Collectiontable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Collectiontable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Collectiontable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Collectiontable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
72
data/src/exceldb/commonsoundtable.rs
Normal file
72
data/src/exceldb/commonsoundtable.rs
Normal file
@@ -0,0 +1,72 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Commonsoundtable {
|
||||
#[serde(rename = "bgmPlayerHidden")]
|
||||
pub bgm_player_hidden: Option<i32>,
|
||||
#[serde(rename = "contentTicketId")]
|
||||
pub content_ticket_id: Option<i32>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "packId")]
|
||||
pub pack_id: Option<i32>,
|
||||
#[serde(rename = "sortId")]
|
||||
pub sort_id: Option<i32>,
|
||||
#[serde(rename = "soundNameTextId")]
|
||||
pub sound_name_text_id: Option<i32>,
|
||||
#[serde(rename = "soundPath")]
|
||||
pub sound_path: String,
|
||||
#[serde(rename = "soundSourceNameTextId")]
|
||||
pub sound_source_name_text_id: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct CommonsoundtableTable {
|
||||
records: Vec<Commonsoundtable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CommonsoundtableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Commonsoundtable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Commonsoundtable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Commonsoundtable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Commonsoundtable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
52
data/src/exceldb/communitydefinetable.rs
Normal file
52
data/src/exceldb/communitydefinetable.rs
Normal file
@@ -0,0 +1,52 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Communitydefinetable {
|
||||
#[serde(rename = "friendSendExpireDay")]
|
||||
pub friend_send_expire_day: i32,
|
||||
#[serde(rename = "maxFriendCount")]
|
||||
pub max_friend_count: i32,
|
||||
#[serde(rename = "maxFriendRecommendCount")]
|
||||
pub max_friend_recommend_count: i32,
|
||||
#[serde(rename = "maxFriendRecvCount")]
|
||||
pub max_friend_recv_count: i32,
|
||||
#[serde(rename = "maxFriendSendCount")]
|
||||
pub max_friend_send_count: i32,
|
||||
}
|
||||
|
||||
pub struct CommunitydefinetableTable {
|
||||
records: Vec<Communitydefinetable>,
|
||||
}
|
||||
|
||||
impl CommunitydefinetableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Communitydefinetable> = serde_json::from_str(&json)?;
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Communitydefinetable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Communitydefinetable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
114
data/src/exceldb/communityweblinktable.rs
Normal file
114
data/src/exceldb/communityweblinktable.rs
Normal file
@@ -0,0 +1,114 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Communityweblinktable {
|
||||
#[serde(rename = "communityRewardCount")]
|
||||
pub community_reward_count: Vec<i32>,
|
||||
#[serde(rename = "communityRewardId")]
|
||||
pub community_reward_id: Vec<i32>,
|
||||
#[serde(rename = "communityRewardType")]
|
||||
pub community_reward_type: Vec<i32>,
|
||||
#[serde(rename = "linkIconCn1")]
|
||||
pub link_icon_cn1: String,
|
||||
#[serde(rename = "linkIconCn2")]
|
||||
pub link_icon_cn2: String,
|
||||
#[serde(rename = "linkIconCn3")]
|
||||
pub link_icon_cn3: String,
|
||||
#[serde(rename = "linkIconEn1")]
|
||||
pub link_icon_en1: String,
|
||||
#[serde(rename = "linkIconEn2")]
|
||||
pub link_icon_en2: String,
|
||||
#[serde(rename = "linkIconEn3")]
|
||||
pub link_icon_en3: String,
|
||||
#[serde(rename = "linkIconJp1")]
|
||||
pub link_icon_jp1: String,
|
||||
#[serde(rename = "linkIconJp2")]
|
||||
pub link_icon_jp2: String,
|
||||
#[serde(rename = "linkIconJp3")]
|
||||
pub link_icon_jp3: String,
|
||||
#[serde(rename = "linkIconKr1")]
|
||||
pub link_icon_kr1: String,
|
||||
#[serde(rename = "linkIconKr2")]
|
||||
pub link_icon_kr2: String,
|
||||
#[serde(rename = "linkIconKr3")]
|
||||
pub link_icon_kr3: String,
|
||||
#[serde(rename = "linkIconTw1")]
|
||||
pub link_icon_tw1: String,
|
||||
#[serde(rename = "linkIconTw2")]
|
||||
pub link_icon_tw2: String,
|
||||
#[serde(rename = "linkIconTw3")]
|
||||
pub link_icon_tw3: String,
|
||||
#[serde(rename = "linkUrlPathCn1")]
|
||||
pub link_url_path_cn1: String,
|
||||
#[serde(rename = "linkUrlPathCn2")]
|
||||
pub link_url_path_cn2: String,
|
||||
#[serde(rename = "linkUrlPathCn3")]
|
||||
pub link_url_path_cn3: String,
|
||||
#[serde(rename = "linkUrlPathEn1")]
|
||||
pub link_url_path_en1: String,
|
||||
#[serde(rename = "linkUrlPathEn2")]
|
||||
pub link_url_path_en2: String,
|
||||
#[serde(rename = "linkUrlPathEn3")]
|
||||
pub link_url_path_en3: String,
|
||||
#[serde(rename = "linkUrlPathJp1")]
|
||||
pub link_url_path_jp1: String,
|
||||
#[serde(rename = "linkUrlPathJp2")]
|
||||
pub link_url_path_jp2: String,
|
||||
#[serde(rename = "linkUrlPathJp3")]
|
||||
pub link_url_path_jp3: String,
|
||||
#[serde(rename = "linkUrlPathKr1")]
|
||||
pub link_url_path_kr1: String,
|
||||
#[serde(rename = "linkUrlPathKr2")]
|
||||
pub link_url_path_kr2: String,
|
||||
#[serde(rename = "linkUrlPathKr3")]
|
||||
pub link_url_path_kr3: String,
|
||||
#[serde(rename = "linkUrlPathTw1")]
|
||||
pub link_url_path_tw1: String,
|
||||
#[serde(rename = "linkUrlPathTw2")]
|
||||
pub link_url_path_tw2: String,
|
||||
#[serde(rename = "linkUrlPathTw3")]
|
||||
pub link_url_path_tw3: String,
|
||||
#[serde(rename = "surveyRewardCount")]
|
||||
pub survey_reward_count: Vec<i32>,
|
||||
#[serde(rename = "surveyRewardId")]
|
||||
pub survey_reward_id: Vec<i32>,
|
||||
#[serde(rename = "surveyRewardType")]
|
||||
pub survey_reward_type: Vec<i32>,
|
||||
}
|
||||
|
||||
pub struct CommunityweblinktableTable {
|
||||
records: Vec<Communityweblinktable>,
|
||||
}
|
||||
|
||||
impl CommunityweblinktableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Communityweblinktable> = serde_json::from_str(&json)?;
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Communityweblinktable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Communityweblinktable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
62
data/src/exceldb/contentgenretable.rs
Normal file
62
data/src/exceldb/contentgenretable.rs
Normal file
@@ -0,0 +1,62 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Contentgenretable {
|
||||
#[serde(rename = "genreDescQuestTextId")]
|
||||
pub genre_desc_quest_text_id: i32,
|
||||
#[serde(rename = "genreTitleQuestTextId")]
|
||||
pub genre_title_quest_text_id: Vec<i32>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
}
|
||||
|
||||
pub struct ContentgenretableTable {
|
||||
records: Vec<Contentgenretable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl ContentgenretableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Contentgenretable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Contentgenretable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Contentgenretable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Contentgenretable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
68
data/src/exceldb/contentopenguidetable.rs
Normal file
68
data/src/exceldb/contentopenguidetable.rs
Normal file
@@ -0,0 +1,68 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Contentopenguidetable {
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "magicValue")]
|
||||
pub magic_value: i32,
|
||||
#[serde(rename = "openDescLocalTextId")]
|
||||
pub open_desc_local_text_id: i32,
|
||||
#[serde(rename = "openIconName")]
|
||||
pub open_icon_name: String,
|
||||
#[serde(rename = "openTitleLocalTextId")]
|
||||
pub open_title_local_text_id: i32,
|
||||
#[serde(rename = "type")]
|
||||
pub r#type: i32,
|
||||
}
|
||||
|
||||
pub struct ContentopenguidetableTable {
|
||||
records: Vec<Contentopenguidetable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl ContentopenguidetableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Contentopenguidetable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Contentopenguidetable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Contentopenguidetable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Contentopenguidetable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
76
data/src/exceldb/contentopentable.rs
Normal file
76
data/src/exceldb/contentopentable.rs
Normal file
@@ -0,0 +1,76 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Contentopentable {
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "openHelpLocalTextId")]
|
||||
pub open_help_local_text_id: Option<i32>,
|
||||
#[serde(rename = "ticketId")]
|
||||
pub ticket_id: i32,
|
||||
}
|
||||
|
||||
pub struct ContentopentableTable {
|
||||
records: Vec<Contentopentable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl ContentopentableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Contentopentable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Contentopentable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Contentopentable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Contentopentable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Contentopentable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
62
data/src/exceldb/contentrankinfotable.rs
Normal file
62
data/src/exceldb/contentrankinfotable.rs
Normal file
@@ -0,0 +1,62 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Contentrankinfotable {
|
||||
#[serde(rename = "evilCastleFloorMyRankMaxCount")]
|
||||
pub evil_castle_floor_my_rank_max_count: i32,
|
||||
#[serde(rename = "evilCastleFloorTopRankMaxCount")]
|
||||
pub evil_castle_floor_top_rank_max_count: i32,
|
||||
#[serde(rename = "evilCastleTotalMyRankMaxCount")]
|
||||
pub evil_castle_total_my_rank_max_count: i32,
|
||||
#[serde(rename = "evilCastleTotalTopRankMaxCount")]
|
||||
pub evil_castle_total_top_rank_max_count: i32,
|
||||
#[serde(rename = "mirrorWarMyRankMaxCount")]
|
||||
pub mirror_war_my_rank_max_count: i32,
|
||||
#[serde(rename = "mirrorWarTopRankMaxCount")]
|
||||
pub mirror_war_top_rank_max_count: i32,
|
||||
#[serde(rename = "monsterHuntMyRankMaxCount")]
|
||||
pub monster_hunt_my_rank_max_count: i32,
|
||||
#[serde(rename = "monsterHuntTopRankMaxCount")]
|
||||
pub monster_hunt_top_rank_max_count: i32,
|
||||
#[serde(rename = "roguelikeMyRankMaxCount")]
|
||||
pub roguelike_my_rank_max_count: i32,
|
||||
#[serde(rename = "roguelikeTopRankMaxCount")]
|
||||
pub roguelike_top_rank_max_count: i32,
|
||||
}
|
||||
|
||||
pub struct ContentrankinfotableTable {
|
||||
records: Vec<Contentrankinfotable>,
|
||||
}
|
||||
|
||||
impl ContentrankinfotableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Contentrankinfotable> = serde_json::from_str(&json)?;
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Contentrankinfotable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Contentrankinfotable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
70
data/src/exceldb/contentsrankrewardtable.rs
Normal file
70
data/src/exceldb/contentsrankrewardtable.rs
Normal file
@@ -0,0 +1,70 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Contentsrankrewardtable {
|
||||
#[serde(rename = "contentsType")]
|
||||
pub contents_type: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "rank")]
|
||||
pub rank: i32,
|
||||
#[serde(rename = "rewardCount")]
|
||||
pub reward_count: Vec<i32>,
|
||||
#[serde(rename = "rewardId")]
|
||||
pub reward_id: Vec<i32>,
|
||||
#[serde(rename = "rewardType")]
|
||||
pub reward_type: Vec<i32>,
|
||||
#[serde(rename = "season")]
|
||||
pub season: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct ContentsrankrewardtableTable {
|
||||
records: Vec<Contentsrankrewardtable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl ContentsrankrewardtableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Contentsrankrewardtable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Contentsrankrewardtable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Contentsrankrewardtable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Contentsrankrewardtable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
68
data/src/exceldb/contenttickettable.rs
Normal file
68
data/src/exceldb/contenttickettable.rs
Normal file
@@ -0,0 +1,68 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Contenttickettable {
|
||||
#[serde(rename = "iconSpriteName")]
|
||||
pub icon_sprite_name: Option<String>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "itemDescNameTextId")]
|
||||
pub item_desc_name_text_id: Option<i32>,
|
||||
#[serde(rename = "itemNameTextId")]
|
||||
pub item_name_text_id: Option<i32>,
|
||||
#[serde(rename = "itemSubNameTextId")]
|
||||
pub item_sub_name_text_id: Option<i32>,
|
||||
#[serde(rename = "type")]
|
||||
pub r#type: i32,
|
||||
}
|
||||
|
||||
pub struct ContenttickettableTable {
|
||||
records: Vec<Contenttickettable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl ContenttickettableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Contenttickettable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Contenttickettable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Contenttickettable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Contenttickettable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
68
data/src/exceldb/contentweblinktable.rs
Normal file
68
data/src/exceldb/contentweblinktable.rs
Normal file
@@ -0,0 +1,68 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Contentweblinktable {
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "linkUrlPathCn")]
|
||||
pub link_url_path_cn: String,
|
||||
#[serde(rename = "linkUrlPathEn")]
|
||||
pub link_url_path_en: String,
|
||||
#[serde(rename = "linkUrlPathJp")]
|
||||
pub link_url_path_jp: String,
|
||||
#[serde(rename = "linkUrlPathKr")]
|
||||
pub link_url_path_kr: String,
|
||||
#[serde(rename = "linkUrlPathTw")]
|
||||
pub link_url_path_tw: String,
|
||||
}
|
||||
|
||||
pub struct ContentweblinktableTable {
|
||||
records: Vec<Contentweblinktable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl ContentweblinktableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Contentweblinktable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Contentweblinktable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Contentweblinktable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Contentweblinktable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
62
data/src/exceldb/cookingpictorialbooktable.rs
Normal file
62
data/src/exceldb/cookingpictorialbooktable.rs
Normal file
@@ -0,0 +1,62 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cookingpictorialbooktable {
|
||||
#[serde(rename = "collectionBuffId")]
|
||||
pub collection_buff_id: i32,
|
||||
#[serde(rename = "cookingId")]
|
||||
pub cooking_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
}
|
||||
|
||||
pub struct CookingpictorialbooktableTable {
|
||||
records: Vec<Cookingpictorialbooktable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CookingpictorialbooktableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cookingpictorialbooktable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cookingpictorialbooktable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cookingpictorialbooktable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cookingpictorialbooktable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
48
data/src/exceldb/cookingresearchtable.rs
Normal file
48
data/src/exceldb/cookingresearchtable.rs
Normal file
@@ -0,0 +1,48 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cookingresearchtable {
|
||||
#[serde(rename = "catalystValue")]
|
||||
pub catalyst_value: Vec<i32>,
|
||||
#[serde(rename = "failItemId")]
|
||||
pub fail_item_id: i32,
|
||||
#[serde(rename = "useSlotCount")]
|
||||
pub use_slot_count: Vec<i32>,
|
||||
}
|
||||
|
||||
pub struct CookingresearchtableTable {
|
||||
records: Vec<Cookingresearchtable>,
|
||||
}
|
||||
|
||||
impl CookingresearchtableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cookingresearchtable> = serde_json::from_str(&json)?;
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cookingresearchtable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cookingresearchtable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
84
data/src/exceldb/cookingtable.rs
Normal file
84
data/src/exceldb/cookingtable.rs
Normal file
@@ -0,0 +1,84 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cookingtable {
|
||||
#[serde(rename = "grade")]
|
||||
pub grade: i32,
|
||||
#[serde(rename = "iconSpriteName")]
|
||||
pub icon_sprite_name: String,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "itemAcquireId")]
|
||||
pub item_acquire_id: Option<Vec<i32>>,
|
||||
#[serde(rename = "itemDescNameTextId")]
|
||||
pub item_desc_name_text_id: i32,
|
||||
#[serde(rename = "itemSubNameTextId")]
|
||||
pub item_sub_name_text_id: i32,
|
||||
#[serde(rename = "materialItemCount")]
|
||||
pub material_item_count: Vec<i32>,
|
||||
#[serde(rename = "materialItemId")]
|
||||
pub material_item_id: Vec<i32>,
|
||||
#[serde(rename = "packId")]
|
||||
pub pack_id: i32,
|
||||
#[serde(rename = "recipeNameTextId")]
|
||||
pub recipe_name_text_id: i32,
|
||||
#[serde(rename = "resultItemCount")]
|
||||
pub result_item_count: i32,
|
||||
#[serde(rename = "resultItemId")]
|
||||
pub result_item_id: i32,
|
||||
#[serde(rename = "stackCount")]
|
||||
pub stack_count: i32,
|
||||
#[serde(rename = "talentLevel")]
|
||||
pub talent_level: i32,
|
||||
}
|
||||
|
||||
pub struct CookingtableTable {
|
||||
records: Vec<Cookingtable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CookingtableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Cookingtable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Cookingtable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Cookingtable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Cookingtable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
100
data/src/exceldb/costumedesignconceptinfotable.rs
Normal file
100
data/src/exceldb/costumedesignconceptinfotable.rs
Normal file
@@ -0,0 +1,100 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Costumedesignconceptinfotable {
|
||||
#[serde(rename = "ageProfileTextId")]
|
||||
pub age_profile_text_id: i32,
|
||||
#[serde(rename = "associationProfileTextId")]
|
||||
pub association_profile_text_id: i32,
|
||||
#[serde(rename = "birthDayProfileTextId")]
|
||||
pub birth_day_profile_text_id: i32,
|
||||
#[serde(rename = "cutSceneDialogProfileTextId")]
|
||||
pub cut_scene_dialog_profile_text_id: Option<Vec<i32>>,
|
||||
#[serde(rename = "cutSceneDialogVoiceResourceName")]
|
||||
pub cut_scene_dialog_voice_resource_name: Option<Vec<String>>,
|
||||
#[serde(rename = "dislikeProfileTextId")]
|
||||
pub dislike_profile_text_id: i32,
|
||||
#[serde(rename = "favoriteProfileTextId")]
|
||||
pub favorite_profile_text_id: i32,
|
||||
#[serde(rename = "generalDialogProfileTextId")]
|
||||
pub general_dialog_profile_text_id: Vec<i32>,
|
||||
#[serde(rename = "generalDialogVoiceResourceName")]
|
||||
pub general_dialog_voice_resource_name: Vec<String>,
|
||||
#[serde(rename = "heightProfileTextId")]
|
||||
pub height_profile_text_id: i32,
|
||||
#[serde(rename = "hobbyProfileTextId")]
|
||||
pub hobby_profile_text_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "preciousProfileTextId")]
|
||||
pub precious_profile_text_id: i32,
|
||||
#[serde(rename = "rumor1ProfileTextId")]
|
||||
pub rumor1_profile_text_id: i32,
|
||||
#[serde(rename = "rumor2ProfileTextId")]
|
||||
pub rumor2_profile_text_id: i32,
|
||||
#[serde(rename = "skillDialogProfileTextId")]
|
||||
pub skill_dialog_profile_text_id: Option<Vec<i32>>,
|
||||
#[serde(rename = "skillDialogVoiceResourceName")]
|
||||
pub skill_dialog_voice_resource_name: Option<Vec<String>>,
|
||||
#[serde(rename = "summaryProfileTextId")]
|
||||
pub summary_profile_text_id: i32,
|
||||
#[serde(rename = "talentDialogProfileTextId")]
|
||||
pub talent_dialog_profile_text_id: Option<Vec<i32>>,
|
||||
#[serde(rename = "talentDialogVoiceResourceName")]
|
||||
pub talent_dialog_voice_resource_name: Option<Vec<String>>,
|
||||
#[serde(rename = "victoryDialogProfileTextId")]
|
||||
pub victory_dialog_profile_text_id: Vec<i32>,
|
||||
#[serde(rename = "victoryDialogVoiceResourceName")]
|
||||
pub victory_dialog_voice_resource_name: Vec<String>,
|
||||
}
|
||||
|
||||
pub struct CostumedesignconceptinfotableTable {
|
||||
records: Vec<Costumedesignconceptinfotable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CostumedesignconceptinfotableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Costumedesignconceptinfotable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Costumedesignconceptinfotable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Costumedesignconceptinfotable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Costumedesignconceptinfotable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
88
data/src/exceldb/costumedesigntable.rs
Normal file
88
data/src/exceldb/costumedesigntable.rs
Normal file
@@ -0,0 +1,88 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Costumedesigntable {
|
||||
#[serde(rename = "costumeId")]
|
||||
pub costume_id: Option<i32>,
|
||||
#[serde(rename = "faceIconName")]
|
||||
pub face_icon_name: Option<String>,
|
||||
#[serde(rename = "faceIllustName")]
|
||||
pub face_illust_name: Option<String>,
|
||||
#[serde(rename = "iconSpriteName")]
|
||||
pub icon_sprite_name: Option<String>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: Option<i32>,
|
||||
#[serde(rename = "illustName")]
|
||||
pub illust_name: Option<String>,
|
||||
#[serde(rename = "inventoryIllustName")]
|
||||
pub inventory_illust_name: Option<String>,
|
||||
#[serde(rename = "isCollabo")]
|
||||
pub is_collabo: Option<i32>,
|
||||
#[serde(rename = "lobbyCutscene")]
|
||||
pub lobby_cutscene: Option<String>,
|
||||
#[serde(rename = "loopPrefabName")]
|
||||
pub loop_prefab_name: Option<Vec<String>>,
|
||||
#[serde(rename = "prefabName")]
|
||||
pub prefab_name: Option<String>,
|
||||
#[serde(rename = "simpleIllustName")]
|
||||
pub simple_illust_name: Option<String>,
|
||||
#[serde(rename = "skillIllustName")]
|
||||
pub skill_illust_name: Option<Vec<String>>,
|
||||
#[serde(rename = "skillTimelineName")]
|
||||
pub skill_timeline_name: Option<String>,
|
||||
#[serde(rename = "voiceResourceName")]
|
||||
pub voice_resource_name: Option<String>,
|
||||
}
|
||||
|
||||
pub struct CostumedesigntableTable {
|
||||
records: Vec<Costumedesigntable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CostumedesigntableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Costumedesigntable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
if let Some(id) = record.id {
|
||||
by_id.insert(id, idx);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Costumedesigntable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Costumedesigntable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Costumedesigntable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
92
data/src/exceldb/costumegrowthtable.rs
Normal file
92
data/src/exceldb/costumegrowthtable.rs
Normal file
@@ -0,0 +1,92 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Costumegrowthtable {
|
||||
#[serde(rename = "getExchangeItemCount")]
|
||||
pub get_exchange_item_count: Option<i32>,
|
||||
#[serde(rename = "getExchangeItemId")]
|
||||
pub get_exchange_item_id: Option<i32>,
|
||||
#[serde(rename = "getExchangeItemType")]
|
||||
pub get_exchange_item_type: Option<i32>,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "growthItemCount")]
|
||||
pub growth_item_count: Option<Vec<i32>>,
|
||||
#[serde(rename = "growthItemId")]
|
||||
pub growth_item_id: Option<Vec<i32>>,
|
||||
#[serde(rename = "growthItemType")]
|
||||
pub growth_item_type: Option<Vec<i32>>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: Option<i32>,
|
||||
#[serde(rename = "mileageItemCount")]
|
||||
pub mileage_item_count: Option<i32>,
|
||||
#[serde(rename = "mileageItemType")]
|
||||
pub mileage_item_type: Option<i32>,
|
||||
#[serde(rename = "overExchangeCount")]
|
||||
pub over_exchange_count: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct CostumegrowthtableTable {
|
||||
records: Vec<Costumegrowthtable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl CostumegrowthtableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Costumegrowthtable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
if let Some(id) = record.id {
|
||||
by_id.insert(id, idx);
|
||||
}
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Costumegrowthtable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Costumegrowthtable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Costumegrowthtable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Costumegrowthtable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
64
data/src/exceldb/costumenodegrouptable.rs
Normal file
64
data/src/exceldb/costumenodegrouptable.rs
Normal file
@@ -0,0 +1,64 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Costumenodegrouptable {
|
||||
#[serde(rename = "charUniqueId")]
|
||||
pub char_unique_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "isActive")]
|
||||
pub is_active: Option<i32>,
|
||||
#[serde(rename = "nodeUIPrefab")]
|
||||
pub node_u_i_prefab: Option<String>,
|
||||
}
|
||||
|
||||
pub struct CostumenodegrouptableTable {
|
||||
records: Vec<Costumenodegrouptable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CostumenodegrouptableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Costumenodegrouptable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Costumenodegrouptable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Costumenodegrouptable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Costumenodegrouptable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
124
data/src/exceldb/costumenodetable.rs
Normal file
124
data/src/exceldb/costumenodetable.rs
Normal file
@@ -0,0 +1,124 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Costumenodetable {
|
||||
#[serde(rename = "activeItemCount")]
|
||||
pub active_item_count: Vec<i32>,
|
||||
#[serde(rename = "activeItemId")]
|
||||
pub active_item_id: Vec<i32>,
|
||||
#[serde(rename = "activeItemType")]
|
||||
pub active_item_type: Vec<i32>,
|
||||
#[serde(rename = "addBuffId")]
|
||||
pub add_buff_id: Option<i32>,
|
||||
#[serde(rename = "addBuffModifyBuffMagicValue")]
|
||||
pub add_buff_modify_buff_magic_value: Option<f32>,
|
||||
#[serde(rename = "addBuffModifyBuffTurn")]
|
||||
pub add_buff_modify_buff_turn: Option<i32>,
|
||||
#[serde(rename = "addBuffModifyBuffValue")]
|
||||
pub add_buff_modify_buff_value: Option<f32>,
|
||||
#[serde(rename = "addBuffOrder")]
|
||||
pub add_buff_order: Option<i32>,
|
||||
#[serde(rename = "addBuffTextOrder")]
|
||||
pub add_buff_text_order: Option<i32>,
|
||||
#[serde(rename = "attackRange")]
|
||||
pub attack_range: Option<i32>,
|
||||
#[serde(rename = "attackRangeCount")]
|
||||
pub attack_range_count: Option<i32>,
|
||||
#[serde(rename = "conditionAddBuffModifyBuffOrder")]
|
||||
pub condition_add_buff_modify_buff_order: Option<i32>,
|
||||
#[serde(rename = "conditionAddBuffModifyBuffTurn")]
|
||||
pub condition_add_buff_modify_buff_turn: Option<i32>,
|
||||
#[serde(rename = "conditionAddBuffModifyBuffValue")]
|
||||
pub condition_add_buff_modify_buff_value: Option<f32>,
|
||||
#[serde(rename = "conditionGrade")]
|
||||
pub condition_grade: Option<i32>,
|
||||
#[serde(rename = "conditionNodeId")]
|
||||
pub condition_node_id: Option<Vec<i32>>,
|
||||
#[serde(rename = "cooldownDecreaseValue")]
|
||||
pub cooldown_decrease_value: Option<i32>,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "modifyBuffMagicValue")]
|
||||
pub modify_buff_magic_value: Option<f32>,
|
||||
#[serde(rename = "modifyBuffOrder")]
|
||||
pub modify_buff_order: Option<i32>,
|
||||
#[serde(rename = "modifyBuffTurn")]
|
||||
pub modify_buff_turn: Option<i32>,
|
||||
#[serde(rename = "modifyBuffValue")]
|
||||
pub modify_buff_value: Option<f32>,
|
||||
#[serde(rename = "nodeGroupType")]
|
||||
pub node_group_type: i32,
|
||||
#[serde(rename = "nodeType")]
|
||||
pub node_type: i32,
|
||||
#[serde(rename = "spDecreaseValue")]
|
||||
pub sp_decrease_value: Option<i32>,
|
||||
#[serde(rename = "statType")]
|
||||
pub stat_type: Option<i32>,
|
||||
#[serde(rename = "statValue")]
|
||||
pub stat_value: Option<f32>,
|
||||
}
|
||||
|
||||
pub struct CostumenodetableTable {
|
||||
records: Vec<Costumenodetable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl CostumenodetableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Costumenodetable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Costumenodetable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Costumenodetable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Costumenodetable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Costumenodetable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
68
data/src/exceldb/costumepictorialbooktable.rs
Normal file
68
data/src/exceldb/costumepictorialbooktable.rs
Normal file
@@ -0,0 +1,68 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Costumepictorialbooktable {
|
||||
#[serde(rename = "chaUniqueId")]
|
||||
pub cha_unique_id: i32,
|
||||
#[serde(rename = "collectionBuffId")]
|
||||
pub collection_buff_id: Vec<i32>,
|
||||
#[serde(rename = "costumeID")]
|
||||
pub costume_i_d: i32,
|
||||
#[serde(rename = "enhanceValue")]
|
||||
pub enhance_value: Vec<i32>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "tabType")]
|
||||
pub tab_type: i32,
|
||||
}
|
||||
|
||||
pub struct CostumepictorialbooktableTable {
|
||||
records: Vec<Costumepictorialbooktable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CostumepictorialbooktableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Costumepictorialbooktable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Costumepictorialbooktable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Costumepictorialbooktable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Costumepictorialbooktable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
74
data/src/exceldb/costumeselecttable.rs
Normal file
74
data/src/exceldb/costumeselecttable.rs
Normal file
@@ -0,0 +1,74 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Costumeselecttable {
|
||||
#[serde(rename = "costumeRewardGroupId")]
|
||||
pub costume_reward_group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "recommendCostumeId")]
|
||||
pub recommend_costume_id: Vec<i32>,
|
||||
}
|
||||
|
||||
pub struct CostumeselecttableTable {
|
||||
records: Vec<Costumeselecttable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl CostumeselecttableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Costumeselecttable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.costume_reward_group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Costumeselecttable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Costumeselecttable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Costumeselecttable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Costumeselecttable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
120
data/src/exceldb/costumetable.rs
Normal file
120
data/src/exceldb/costumetable.rs
Normal file
@@ -0,0 +1,120 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Costumetable {
|
||||
#[serde(rename = "attackMoveType")]
|
||||
pub attack_move_type: Option<i32>,
|
||||
#[serde(rename = "attackRange")]
|
||||
pub attack_range: Option<i32>,
|
||||
#[serde(rename = "attackRangeCount")]
|
||||
pub attack_range_count: i32,
|
||||
#[serde(rename = "attackType")]
|
||||
pub attack_type: Option<i32>,
|
||||
#[serde(rename = "buffImmuneGroupID")]
|
||||
pub buff_immune_group_i_d: Option<i32>,
|
||||
#[serde(rename = "connectedCostumeDesignId")]
|
||||
pub connected_costume_design_id: Vec<i32>,
|
||||
#[serde(rename = "costumeDescNameTextId")]
|
||||
pub costume_desc_name_text_id: i32,
|
||||
#[serde(rename = "costumeDialog")]
|
||||
pub costume_dialog: i32,
|
||||
#[serde(rename = "costumeNameTextId")]
|
||||
pub costume_name_text_id: i32,
|
||||
#[serde(rename = "growthGroupId")]
|
||||
pub growth_group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "japaneseCharacterVoiceActorNameTextId")]
|
||||
pub japanese_character_voice_actor_name_text_id: Option<i32>,
|
||||
#[serde(rename = "koreanCharacterVoiceActorNameTextId")]
|
||||
pub korean_character_voice_actor_name_text_id: Option<i32>,
|
||||
#[serde(rename = "maxLevel")]
|
||||
pub max_level: Option<i32>,
|
||||
#[serde(rename = "norSubAttackBuffId")]
|
||||
pub nor_sub_attack_buff_id: Option<i32>,
|
||||
#[serde(rename = "norSubAttackDescSkillTextId")]
|
||||
pub nor_sub_attack_desc_skill_text_id: Option<i32>,
|
||||
#[serde(rename = "norSubAttackNameSkillTextId")]
|
||||
pub nor_sub_attack_name_skill_text_id: i32,
|
||||
#[serde(rename = "normalAttackDescSkillTextId")]
|
||||
pub normal_attack_desc_skill_text_id: i32,
|
||||
#[serde(rename = "normalAttackNameSkillTextId")]
|
||||
pub normal_attack_name_skill_text_id: i32,
|
||||
#[serde(rename = "notTrash")]
|
||||
pub not_trash: i32,
|
||||
#[serde(rename = "packId")]
|
||||
pub pack_id: Option<i32>,
|
||||
#[serde(rename = "skillGroupId")]
|
||||
pub skill_group_id: Option<i32>,
|
||||
#[serde(rename = "spAttackAddCount")]
|
||||
pub sp_attack_add_count: i32,
|
||||
#[serde(rename = "targetType")]
|
||||
pub target_type: Option<i32>,
|
||||
#[serde(rename = "useRoguelike")]
|
||||
pub use_roguelike: Option<i32>,
|
||||
#[serde(rename = "useUniqueCharId")]
|
||||
pub use_unique_char_id: i32,
|
||||
}
|
||||
|
||||
pub struct CostumetableTable {
|
||||
records: Vec<Costumetable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl CostumetableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Costumetable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.growth_group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Costumetable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Costumetable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Costumetable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Costumetable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
72
data/src/exceldb/currencytable.rs
Normal file
72
data/src/exceldb/currencytable.rs
Normal file
@@ -0,0 +1,72 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Currencytable {
|
||||
#[serde(rename = "iconSpriteNameLarge")]
|
||||
pub icon_sprite_name_large: Option<String>,
|
||||
#[serde(rename = "iconSpriteNameSmall")]
|
||||
pub icon_sprite_name_small: Option<String>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: Option<i32>,
|
||||
#[serde(rename = "itemDescNameTextId")]
|
||||
pub item_desc_name_text_id: Option<i32>,
|
||||
#[serde(rename = "itemNameTextId")]
|
||||
pub item_name_text_id: Option<i32>,
|
||||
#[serde(rename = "targetItemId")]
|
||||
pub target_item_id: Option<i32>,
|
||||
#[serde(rename = "targetItemType")]
|
||||
pub target_item_type: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct CurrencytableTable {
|
||||
records: Vec<Currencytable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl CurrencytableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Currencytable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
if let Some(id) = record.id {
|
||||
by_id.insert(id, idx);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Currencytable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Currencytable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Currencytable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
74
data/src/exceldb/datingcostumetable.rs
Normal file
74
data/src/exceldb/datingcostumetable.rs
Normal file
@@ -0,0 +1,74 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Datingcostumetable {
|
||||
#[serde(rename = "costumeId")]
|
||||
pub costume_id: i32,
|
||||
#[serde(rename = "episodeGroupId")]
|
||||
pub episode_group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
}
|
||||
|
||||
pub struct DatingcostumetableTable {
|
||||
records: Vec<Datingcostumetable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl DatingcostumetableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Datingcostumetable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.episode_group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Datingcostumetable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Datingcostumetable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Datingcostumetable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Datingcostumetable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
44
data/src/exceldb/datingdefaulttable.rs
Normal file
44
data/src/exceldb/datingdefaulttable.rs
Normal file
@@ -0,0 +1,44 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Datingdefaulttable {
|
||||
#[serde(rename = "datingApMax")]
|
||||
pub dating_ap_max: i32,
|
||||
}
|
||||
|
||||
pub struct DatingdefaulttableTable {
|
||||
records: Vec<Datingdefaulttable>,
|
||||
}
|
||||
|
||||
impl DatingdefaulttableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Datingdefaulttable> = serde_json::from_str(&json)?;
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Datingdefaulttable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Datingdefaulttable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
96
data/src/exceldb/datingepisodetable.rs
Normal file
96
data/src/exceldb/datingepisodetable.rs
Normal file
@@ -0,0 +1,96 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Datingepisodetable {
|
||||
#[serde(rename = "datingDialogGroupId")]
|
||||
pub dating_dialog_group_id: i32,
|
||||
#[serde(rename = "datingMessage1")]
|
||||
pub dating_message1: Option<i32>,
|
||||
#[serde(rename = "datingMessage2")]
|
||||
pub dating_message2: i32,
|
||||
#[serde(rename = "episodeTitleDatingTextId")]
|
||||
pub episode_title_dating_text_id: i32,
|
||||
#[serde(rename = "episodeType")]
|
||||
pub episode_type: Option<i32>,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "rewardCount")]
|
||||
pub reward_count: i32,
|
||||
#[serde(rename = "rewardDatingPoint")]
|
||||
pub reward_dating_point: i32,
|
||||
#[serde(rename = "rewardId")]
|
||||
pub reward_id: i32,
|
||||
#[serde(rename = "rewardType")]
|
||||
pub reward_type: i32,
|
||||
#[serde(rename = "skipQuestTextId")]
|
||||
pub skip_quest_text_id: i32,
|
||||
#[serde(rename = "talkStatusTextId")]
|
||||
pub talk_status_text_id: i32,
|
||||
#[serde(rename = "timelineName")]
|
||||
pub timeline_name: String,
|
||||
}
|
||||
|
||||
pub struct DatingepisodetableTable {
|
||||
records: Vec<Datingepisodetable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl DatingepisodetableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Datingepisodetable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.dating_dialog_group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Datingepisodetable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Datingepisodetable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Datingepisodetable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Datingepisodetable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
80
data/src/exceldb/datingmessagetable.rs
Normal file
80
data/src/exceldb/datingmessagetable.rs
Normal file
@@ -0,0 +1,80 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Datingmessagetable {
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "message1DatingTextId")]
|
||||
pub message1_dating_text_id: Option<i32>,
|
||||
#[serde(rename = "messageType")]
|
||||
pub message_type: i32,
|
||||
#[serde(rename = "speakerType")]
|
||||
pub speaker_type: Option<i32>,
|
||||
#[serde(rename = "triggerType")]
|
||||
pub trigger_type: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct DatingmessagetableTable {
|
||||
records: Vec<Datingmessagetable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl DatingmessagetableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Datingmessagetable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Datingmessagetable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Datingmessagetable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Datingmessagetable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Datingmessagetable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
70
data/src/exceldb/datingtexttable.rs
Normal file
70
data/src/exceldb/datingtexttable.rs
Normal file
@@ -0,0 +1,70 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Datingtexttable {
|
||||
#[serde(rename = "date")]
|
||||
pub date: String,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "text")]
|
||||
pub text: String,
|
||||
#[serde(rename = "text_cn")]
|
||||
pub text_cn: String,
|
||||
#[serde(rename = "text_en")]
|
||||
pub text_en: String,
|
||||
#[serde(rename = "text_jp")]
|
||||
pub text_jp: String,
|
||||
#[serde(rename = "text_tw")]
|
||||
pub text_tw: String,
|
||||
}
|
||||
|
||||
pub struct DatingtexttableTable {
|
||||
records: Vec<Datingtexttable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl DatingtexttableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Datingtexttable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Datingtexttable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Datingtexttable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Datingtexttable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
70
data/src/exceldb/defaultidcardsettingtable.rs
Normal file
70
data/src/exceldb/defaultidcardsettingtable.rs
Normal file
@@ -0,0 +1,70 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Defaultidcardsettingtable {
|
||||
#[serde(rename = "cardItemEnumType")]
|
||||
pub card_item_enum_type: i32,
|
||||
#[serde(rename = "colorValue")]
|
||||
pub color_value: Option<String>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "itemId")]
|
||||
pub item_id: Option<i32>,
|
||||
#[serde(rename = "positionXValue")]
|
||||
pub position_x_value: Option<f32>,
|
||||
#[serde(rename = "positionYValue")]
|
||||
pub position_y_value: Option<f32>,
|
||||
#[serde(rename = "scaleValue")]
|
||||
pub scale_value: f32,
|
||||
}
|
||||
|
||||
pub struct DefaultidcardsettingtableTable {
|
||||
records: Vec<Defaultidcardsettingtable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl DefaultidcardsettingtableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Defaultidcardsettingtable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Defaultidcardsettingtable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Defaultidcardsettingtable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Defaultidcardsettingtable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
86
data/src/exceldb/dispatchtable.rs
Normal file
86
data/src/exceldb/dispatchtable.rs
Normal file
@@ -0,0 +1,86 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Dispatchtable {
|
||||
#[serde(rename = "dispatchEndLocalTextId")]
|
||||
pub dispatch_end_local_text_id: i32,
|
||||
#[serde(rename = "dispatchLevel")]
|
||||
pub dispatch_level: i32,
|
||||
#[serde(rename = "dispatchLocalTextId")]
|
||||
pub dispatch_local_text_id: i32,
|
||||
#[serde(rename = "dispatchTime")]
|
||||
pub dispatch_time: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "nameTextId")]
|
||||
pub name_text_id: i32,
|
||||
#[serde(rename = "prefabName")]
|
||||
pub prefab_name: String,
|
||||
#[serde(rename = "rewardGroupId")]
|
||||
pub reward_group_id: i32,
|
||||
#[serde(rename = "spriteName")]
|
||||
pub sprite_name: String,
|
||||
}
|
||||
|
||||
pub struct DispatchtableTable {
|
||||
records: Vec<Dispatchtable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl DispatchtableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Dispatchtable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.reward_group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Dispatchtable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Dispatchtable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Dispatchtable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Dispatchtable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
84
data/src/exceldb/endguidetable.rs
Normal file
84
data/src/exceldb/endguidetable.rs
Normal file
@@ -0,0 +1,84 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Endguidetable {
|
||||
#[serde(rename = "atlasName")]
|
||||
pub atlas_name: Option<String>,
|
||||
#[serde(rename = "groupId")]
|
||||
pub group_id: i32,
|
||||
#[serde(rename = "guideDescLocalTextId")]
|
||||
pub guide_desc_local_text_id: i32,
|
||||
#[serde(rename = "guideNameLocalTextId")]
|
||||
pub guide_name_local_text_id: i32,
|
||||
#[serde(rename = "guideTextureName")]
|
||||
pub guide_texture_name: Option<String>,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "spinePrefabName")]
|
||||
pub spine_prefab_name: String,
|
||||
#[serde(rename = "spriteName")]
|
||||
pub sprite_name: Option<String>,
|
||||
}
|
||||
|
||||
pub struct EndguidetableTable {
|
||||
records: Vec<Endguidetable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl EndguidetableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Endguidetable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.group_id).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Endguidetable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Endguidetable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Endguidetable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Endguidetable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
76
data/src/exceldb/endstorydefaulttable.rs
Normal file
76
data/src/exceldb/endstorydefaulttable.rs
Normal file
@@ -0,0 +1,76 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Endstorydefaulttable {
|
||||
#[serde(rename = "endGuideTableGroupID")]
|
||||
pub end_guide_table_group_i_d: i32,
|
||||
#[serde(rename = "endPackId")]
|
||||
pub end_pack_id: i32,
|
||||
#[serde(rename = "endPackTutorialId")]
|
||||
pub end_pack_tutorial_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
}
|
||||
|
||||
pub struct EndstorydefaulttableTable {
|
||||
records: Vec<Endstorydefaulttable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
by_group: HashMap<i32, Vec<usize>>,
|
||||
}
|
||||
|
||||
impl EndstorydefaulttableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Endstorydefaulttable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
let mut by_group: HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
by_group.entry(record.end_guide_table_group_i_d).or_insert_with(Vec::new).push(idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
by_group,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Endstorydefaulttable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
pub fn by_group(&self, group_id: i32) -> impl Iterator<Item = &Endstorydefaulttable> + '_ {
|
||||
self.by_group
|
||||
.get(&group_id)
|
||||
.into_iter()
|
||||
.flat_map(|indices| indices.iter())
|
||||
.map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Endstorydefaulttable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Endstorydefaulttable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
66
data/src/exceldb/equipmentgradetable.rs
Normal file
66
data/src/exceldb/equipmentgradetable.rs
Normal file
@@ -0,0 +1,66 @@
|
||||
// Auto-generated from JSON data
|
||||
// Do not edit manually
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Equipmentgradetable {
|
||||
#[serde(rename = "equipGradeLocalTextId")]
|
||||
pub equip_grade_local_text_id: i32,
|
||||
#[serde(rename = "id")]
|
||||
pub id: i32,
|
||||
#[serde(rename = "rankSmeltItemCount")]
|
||||
pub rank_smelt_item_count: Vec<i32>,
|
||||
#[serde(rename = "rankSmeltItemId")]
|
||||
pub rank_smelt_item_id: Vec<i32>,
|
||||
#[serde(rename = "rankSmeltItemType")]
|
||||
pub rank_smelt_item_type: Vec<i32>,
|
||||
}
|
||||
|
||||
pub struct EquipmentgradetableTable {
|
||||
records: Vec<Equipmentgradetable>,
|
||||
by_id: HashMap<i32, usize>,
|
||||
}
|
||||
|
||||
impl EquipmentgradetableTable {
|
||||
pub fn load(path: &str) -> Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
let records: Vec<Equipmentgradetable> = serde_json::from_str(&json)?;
|
||||
|
||||
let mut by_id = HashMap::with_capacity(records.len());
|
||||
|
||||
for (idx, record) in records.iter().enumerate() {
|
||||
by_id.insert(record.id, idx);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
records,
|
||||
by_id,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get(&self, id: i32) -> Option<&Equipmentgradetable> {
|
||||
self.by_id.get(&id).map(|&idx| &self.records[idx])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all(&self) -> &[Equipmentgradetable] {
|
||||
&self.records
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> std::slice::Iter<Equipmentgradetable> {
|
||||
self.records.iter()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.records.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.records.is_empty()
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user