[add] Engine

This commit is contained in:
2022-08-26 16:48:17 +08:00
parent f67e566f2a
commit d9c19f096c
197 changed files with 10626 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import { TableManager } from "../TableManager";
import { StringExampleTableRow, StringTableExample } from "./Tables/StringTableExample";
const { ccclass } = cc._decorator;
@ccclass
export default class CSSettingsV3Example {
private static _stringExample: StringTableExample;
/** 共用_字串表#string.xlsx */
public static get StringExample(): StringTableExample { return this._stringExample = this._stringExample || TableManager.InitTable("#string", StringTableExample, StringExampleTableRow); }
}

View File

@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "04f57003-d6a1-4fee-adf8-69994db08f05",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,82 @@
import CSSettingsV3Example from "./CSSettingsV3Example";
import { StringExampleTable } from "./Tables/StringTableExample";
const { ccclass, property } = cc._decorator;
@ccclass
export default class TableUseExample extends cc.Component {
start() {
//#region StringExample表
cc.log("----------------#stringExample");
cc.log(CSSettingsV3Example.StringExample instanceof StringExampleTable); // true
cc.log(Array.isArray(CSSettingsV3Example.StringExample)); // true, 所以Array相關的方法都可以拿來操作
cc.log(CSSettingsV3Example.StringExample.length);
cc.log(CSSettingsV3Example.StringExample.Count); // 跟length一樣
cc.log(CSSettingsV3Example.StringExample.ContainsRow(11)); // 是否包含id=11的Row
cc.log(11 in CSSettingsV3Example.StringExample); // 同上
cc.log(CSSettingsV3Example.StringExample[1].MsgZnCh);
cc.log(CSSettingsV3Example.StringExample[1]["MsgZnCh"]); // 同上
cc.log(CSSettingsV3Example["StringExample"][1]["MsgZnCh"]); // 同上
cc.log("----------------");
for (let row of CSSettingsV3Example.StringExample) {
if (row) { // 如果Row沒有連號, 那有可能取到undefined值, 要先判斷, 不想判斷就用 CSSettings.StringExample.Rows
cc.log(row.Id, row.MsgZnCh);
}
}
cc.log("----------------");
for (let id of CSSettingsV3Example.StringExample.Keys) {
cc.log(id); // 只會列出有值的id, undefined會跳過
}
cc.log("----------------");
for (let row of CSSettingsV3Example.StringExample.Rows) {
cc.log(row.Id, row.MsgZnCh); // 只會列出有值的Row, undefined會跳過
}
//#endregion
//#region StringExample表 #StringFilter表
cc.log("----------------#stringExample#string_filter");
//cc.log(CSSettings.StringExample.StringFilter instanceof StringFilterTable); // true
cc.log(Array.isArray(CSSettingsV3Example.StringExample.StringFilter)); // true, 所以Array相關的方法都可以拿來操作
cc.log(CSSettingsV3Example.StringExample.StringFilter.length);
cc.log(CSSettingsV3Example.StringExample.StringFilter.Count); // 跟length一樣
cc.log(CSSettingsV3Example.StringExample.StringFilter.ContainsRow(11)); // 是否包含id=11的Row
cc.log(11 in CSSettingsV3Example.StringExample.StringFilter); // 同上
cc.log(CSSettingsV3Example.StringExample.StringFilter[1].FilterWord);
cc.log(CSSettingsV3Example.StringExample.StringFilter[1]["FilterWord"]); // 同上
cc.log(CSSettingsV3Example["StringExample"]["StringFilter"][1]["FilterWord"]); // 同上
cc.log("----------------");
for (let row of CSSettingsV3Example.StringExample.StringFilter) {
if (row) { // 如果Row沒有連號, 那有可能取到undefined值, 要先判斷, 不想判斷就用 CSSettings.StringExample.StringFilter.Rows
cc.log(row.Id, row.FilterWord);
}
}
cc.log("----------------");
for (let id of CSSettingsV3Example.StringExample.StringFilter.Keys) {
cc.log(id); // 只會列出有值的id, undefined會跳過
}
cc.log("----------------");
for (let row of CSSettingsV3Example.StringExample.StringFilter.Rows) {
cc.log(row.Id, row.FilterWord); // 只會列出有值的Row, undefined會跳過
}
//#endregion
cc.log("----------------");
//CSSettingsV3.ResetTables(); // 重置表
}
}

View File

@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "27d36ad6-da65-4673-abdb-4635a1a3d3a8",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.3",
"uuid": "e65b6243-578c-4cea-ac46-1dfd4d455017",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}

View File

@@ -0,0 +1,45 @@
import { ITableRow } from "../../Core/ITableRow";
import { TableBase } from "../../Core/TableBase";
import { TableManager } from "../../TableManager";
/**
* 共用_字串表#string.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class StringTableExample extends TableBase<StringExampleTableRow> {
private _stringFilter: StringFilterTable;
/** 共用_字串表#string.xlsx > #string_filter */
public get StringFilter(): StringFilterTable { return this._stringFilter = this._stringFilter || TableManager.InitTable("#string#string_filter", StringFilterTable, StringFilterTableRow); }
}
/**
* #string
*/
export class StringExampleTable extends TableBase<StringExampleTableRow> {}
export class StringExampleTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 英文訊息 */
MsgEn: string;
/** 繁體中文訊息 */
MsgZnTw: string;
/** 簡體中文讯息 */
MsgZnCh: string;
/** 越南文讯息 */
MsgVi: string;
/** 泰文讯息 */
MsgTh: string;
}
/**
* #string_filter
*/
export class StringFilterTable extends TableBase<StringFilterTableRow> {}
export class StringFilterTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 過濾字串 */
FilterWord: string;
}

View File

@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "c4bea919-96cd-40ee-a5f7-d9327414b1b2",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}