281 lines
8.3 KiB
JavaScript
281 lines
8.3 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, 'c5692vnhwNF5J9nI7VNKQNW', 'GameConfig');
|
|
// Script/module/Config/GameConfig.ts
|
|
|
|
"use strict";
|
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.GameConfig = void 0;
|
|
var share_1 = require("../Share/share");
|
|
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
|
var GameConfig = /** @class */ (function () {
|
|
function GameConfig() {
|
|
}
|
|
GameConfig_1 = GameConfig;
|
|
Object.defineProperty(GameConfig, "Instance", {
|
|
// static LEVEL_INFO: {
|
|
// id: string; //地图ID
|
|
// start: string[][]; //起始状态
|
|
// goal: string[][]; //目标状态
|
|
// middle: string[][][]; //中间状态
|
|
// steps: number; //最大步数
|
|
// }[];
|
|
//游戏内信息
|
|
get: function () {
|
|
if (this._instance == null) {
|
|
this._instance = new GameConfig_1();
|
|
}
|
|
return this._instance;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
//getSeedRandom
|
|
GameConfig.init = function (Authentication) {
|
|
this.CLICK_init();
|
|
this.LEVEL_INFO_init();
|
|
this.GM_INFO_init();
|
|
var self = this;
|
|
//GAME_DATA 废弃了,暂时不删除以防后面修改回 一整局传一次
|
|
this.GAME_DATA = [];
|
|
share_1.WeChat.setShare(location.href);
|
|
if (!Authentication)
|
|
self.Authentication();
|
|
};
|
|
//数据备用
|
|
GameConfig.GM_INFO_init = function () {
|
|
this.GM_INFO = {
|
|
isCustom: false,
|
|
mean_Time: 0,
|
|
total: 0,
|
|
currSeed: 200000,
|
|
gameId: "100019",
|
|
userId: 0,
|
|
guide: true,
|
|
url: "https://api.sparkus.cn",
|
|
success: false,
|
|
matchId: null,
|
|
custom: 0,
|
|
round: 0,
|
|
level: 0,
|
|
guide_Level: 4,
|
|
startTime: -1,
|
|
random: 0,
|
|
stepTimeList: 0,
|
|
successList: [],
|
|
fen: 0,
|
|
score: 0,
|
|
igniteCount: 0,
|
|
min_Steps: 0,
|
|
min_Time: 0 //每一把上次距离洪峰到来时间
|
|
};
|
|
};
|
|
GameConfig.GM_INFO_SET = function (key, value) {
|
|
this.GM_INFO[key] = value;
|
|
};
|
|
GameConfig.CLICK_init = function () {
|
|
this.CLICK_DATA =
|
|
{
|
|
type: 1,
|
|
success: false,
|
|
round: 0,
|
|
duration: 0,
|
|
rightChoiceOuter: [],
|
|
userChoiceOuter: [],
|
|
rightChoiceInner: [],
|
|
userChoiceInner: [],
|
|
};
|
|
};
|
|
GameConfig.CLICK_SET = function (key, value) {
|
|
this.CLICK_DATA[key] = value;
|
|
};
|
|
GameConfig.LEVEL_INFO_init = function () {
|
|
this.LEVEL_INFO = [{
|
|
"id": "1",
|
|
"inside": 3,
|
|
"insideType": 1,
|
|
"outside": 0,
|
|
"outsideType": 1,
|
|
"showTime": 1.2,
|
|
},
|
|
{
|
|
"id": "2",
|
|
"inside": 3,
|
|
"insideType": 2,
|
|
"outside": 0,
|
|
"outsideType": 1,
|
|
"showTime": 1.2,
|
|
},
|
|
{
|
|
"id": "3",
|
|
"inside": 3,
|
|
"insideType": 3,
|
|
"outside": 0,
|
|
"outsideType": 1,
|
|
"showTime": 1,
|
|
},
|
|
{
|
|
"id": "4",
|
|
"inside": 4,
|
|
"insideType": 3,
|
|
"outside": 0,
|
|
"outsideType": 1,
|
|
"showTime": 1,
|
|
},
|
|
{
|
|
"id": "5",
|
|
"inside": 0,
|
|
"insideType": 1,
|
|
"outside": 1,
|
|
"outsideType": 1,
|
|
"showTime": 0.9,
|
|
},
|
|
{
|
|
"id": "6",
|
|
"inside": 0,
|
|
"insideType": 1,
|
|
"outside": 1,
|
|
"outsideType": 2,
|
|
"showTime": 0.9,
|
|
},
|
|
{
|
|
"id": "7",
|
|
"inside": 0,
|
|
"insideType": 1,
|
|
"outside": 2,
|
|
"outsideType": 1,
|
|
"showTime": 1.2,
|
|
},
|
|
{
|
|
"id": "8",
|
|
"inside": 0,
|
|
"insideType": 1,
|
|
"outside": 3,
|
|
"outsideType": 2,
|
|
"showTime": 1.2,
|
|
},
|
|
{
|
|
"id": "9",
|
|
"inside": 3,
|
|
"insideType": 1,
|
|
"outside": 1,
|
|
"outsideType": 1,
|
|
"showTime": 1.2,
|
|
},
|
|
{
|
|
"id": "10",
|
|
"inside": 3,
|
|
"insideType": 2,
|
|
"outside": 1,
|
|
"outsideType": 2,
|
|
"showTime": 1.2,
|
|
},
|
|
{
|
|
"id": "11",
|
|
"inside": 3,
|
|
"insideType": 1,
|
|
"outside": 2,
|
|
"outsideType": 1,
|
|
"showTime": 1.8,
|
|
},
|
|
{
|
|
"id": "12",
|
|
"inside": 3,
|
|
"insideType": 2,
|
|
"outside": 2,
|
|
"outsideType": 2,
|
|
"showTime": 1.8,
|
|
},
|
|
{
|
|
"id": "13",
|
|
"inside": 4,
|
|
"insideType": 3,
|
|
"outside": 3,
|
|
"outsideType": 3,
|
|
"showTime": 1.8,
|
|
},
|
|
{
|
|
"id": "14",
|
|
"inside": 4,
|
|
"insideType": 3,
|
|
"outside": 3,
|
|
"outsideType": 3,
|
|
"showTime": 1.8,
|
|
},
|
|
{
|
|
"id": "15",
|
|
"inside": 5,
|
|
"insideType": 3,
|
|
"outside": 3,
|
|
"outsideType": 3,
|
|
"showTime": 1.5,
|
|
},
|
|
{
|
|
"id": "16",
|
|
"inside": 5,
|
|
"insideType": 3,
|
|
"outside": 3,
|
|
"outsideType": 3,
|
|
"showTime": 1.5,
|
|
}
|
|
];
|
|
this.GUIDE_INFO = [
|
|
{
|
|
"id": "1",
|
|
"inside": 3,
|
|
"insideType": 1,
|
|
"outside": 0,
|
|
"outsideType": 1,
|
|
"showTime": 10000,
|
|
},
|
|
{
|
|
"id": "5",
|
|
"inside": 0,
|
|
"insideType": 1,
|
|
"outside": 1,
|
|
"outsideType": 1,
|
|
"showTime": 10000,
|
|
},
|
|
{
|
|
"id": "7",
|
|
"inside": 0,
|
|
"insideType": 1,
|
|
"outside": 2,
|
|
"outsideType": 1,
|
|
"showTime": 10000,
|
|
},
|
|
];
|
|
// this.LEVEL_INFO = [{"id":"0001", //地图ID
|
|
// "start":[['r'], ['b'], ['g']], //起始状态
|
|
// "goal":[[], ['r', 'g'], ['b']], //目标状态
|
|
// "middle":[[['b', 'r', 'g'], [], []], [['g'], ['b'], ['r']], [['r', 'b'], ['g'], []]],//中间状态
|
|
// "steps":17 //最大步数
|
|
// }];
|
|
// 0 12 3
|
|
// 312 0 0 2 3 1 13 2 0
|
|
// [2], [1], [3]
|
|
// [[2, 1, 3], [], []]
|
|
// [[], [2, 3], [1]]
|
|
// [[1, 2], [], [3]]
|
|
// [[[1], [2, 3], []],
|
|
// [[1], [], [3, 2]]]
|
|
};
|
|
GameConfig.Authentication = function () {
|
|
cc.fx.GameTool.Authentication();
|
|
};
|
|
var GameConfig_1;
|
|
//所有控制信息都通过GameAppStart内控制
|
|
GameConfig._instance = null;
|
|
GameConfig = GameConfig_1 = __decorate([
|
|
ccclass('GameConfig')
|
|
], GameConfig);
|
|
return GameConfig;
|
|
}());
|
|
exports.GameConfig = GameConfig;
|
|
|
|
cc._RF.pop(); |