Commit 629230a5 authored by rockyl's avatar rockyl

调整目录

parent 88d6b576
......@@ -19,7 +19,7 @@ export class GenerateDependencePlugin implements plugins.Command {
let content = templateHeader;
for(let name of projectConfig.settings.services){
const serviceName = (name.charAt(0).toUpperCase() + name.substr(1)) + 'Service';
content += `import './services/${serviceName}'\n`;
content += `import '../game/services/${serviceName}'\n`;
}
content += '\n';
......@@ -29,12 +29,12 @@ export class GenerateDependencePlugin implements plugins.Command {
for (let component of binding.components) {
const name = component.script;
content += `import './${name}'\n`;
content += `import '../game/${name}'\n`;
}
}
}
fs.writeFileSync('src/MustCompile.ts', content);
fs.writeFileSync('src/generated/MustCompile.ts', content);
}
[options: string]: any;
......
import AssetAdapter from "./views/adapters/AssetAdapter";
import ThemeAdapter from "./views/adapters/ThemeAdapter";
import LoadingView from "./views/LoadingView";
import GameConfig from "./model/GameConfig";
import MainStage from "./views/MainStage";
import {Dispatcher} from "@alienlib/support";
import {init as initStageProxy} from "@alienlib/support/StageProxy";
import MainBase from './core/MainBase'
import GameConfig from "./game/model/GameConfig";
import {init as initLocalStorage} from "@alienlib/support/LocalStorage";
import './MustCompile'
class Main extends eui.UILayer {
constructor() {
super();
class Main extends MainBase {
this.once(egret.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
}
protected onAddedToStage(): void {
super.onAddedToStage();
private onAddedToStage() {
Dispatcher.init();
initStageProxy(this.stage, this);
initLocalStorage(GameConfig.gameName);
this.stage.scaleMode = egret.Capabilities.isMobile ? egret.StageScaleMode.FIXED_WIDTH : egret.StageScaleMode.SHOW_ALL;
this.stage.orientation = egret.Capabilities.isMobile ? egret.OrientationMode.PORTRAIT : egret.OrientationMode.AUTO;
}
protected createChildren(): void {
super.createChildren();
egret.registerImplementation("eui.IAssetAdapter", new AssetAdapter());
egret.registerImplementation("eui.IThemeAdapter", new ThemeAdapter());
this.runGame().catch(e => {
console.log(e);
})
}
private async runGame() {
await this.loadResource();
this.createGameScene();
}
private async loadResource() {
try {
egret.ImageLoader.crossOrigin = "anonymous";
const resBasePath = window['resPath'] || '';
await RES.loadConfig("default.res.json", resBasePath + "resource/");
await this.loadTheme();
let loadingView = LoadingView.instance;
this.addChild(loadingView);
await RES.loadGroup("common", 0, loadingView);
}
catch (e) {
console.error(e);
}
}
private loadTheme() {
return new Promise((resolve, reject) => {
let theme = new eui.Theme("resource/default.thm.json", this.stage);
theme.addEventListener(eui.UIEvent.COMPLETE, () => {
resolve();
}, this);
})
}
/**
* 创建场景界面
* Create scene interface
*/
protected createGameScene(): void {
let mainStage:MainStage = MainStage.instance;
this.addChildAt(mainStage, 0);
}
}
/**
* THIS FILE WAS GENERATE BY COMPILER
* DO NOT MODIFY THIS FILE
*/
import './services/StorageService'
import './services/MainService'
import './services/DefenseService'
import './services/BuriedPointService'
import './services/BadgeService'
import './components/SceneMenu'
import './components/Badge'
import './components/ButtonStart'
import './components/BuriedPointButton'
import './components/Breath'
import './components/ButtonRule'
import './components/BuriedPointButton'
import './components/ScenePlay'
import './components/ButtonBack'
import './components/GameViewLabel'
import './components/PanelRule'
......@@ -3,8 +3,6 @@
*/
import lang from "./lang";
import {gameInfo} from "./model/data-center";
import Toast from "./views/Toast";
export function showErrorAlert(e = null, callback?){
let text = !e || e instanceof Error ? lang.net_error : e;
......@@ -26,10 +24,3 @@ export function catchError(p, callback?){
showErrorAlert(e, callback);
})
}
export function showNoMoreCredits(){
Toast.show({text: gameInfo.creditUnit + lang.no_more_credits});
}
export function delayLoad(){
}
import AssetAdapter from "./view/adapters/AssetAdapter";
import ThemeAdapter from "./view/adapters/ThemeAdapter";
import LoadingView from "./view/LoadingView";
import MainStage from "./MainStage";
import {Dispatcher} from "@alienlib/support";
import {init as initStageProxy} from "@alienlib/support/StageProxy";
import '../generated/MustCompile'
export default class MainBase extends eui.UILayer {
constructor() {
super();
this.once(egret.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
}
protected onAddedToStage() {
Dispatcher.init();
initStageProxy(this.stage, this);
this.stage.scaleMode = egret.Capabilities.isMobile ? egret.StageScaleMode.FIXED_WIDTH : egret.StageScaleMode.SHOW_ALL;
this.stage.orientation = egret.Capabilities.isMobile ? egret.OrientationMode.PORTRAIT : egret.OrientationMode.AUTO;
}
protected createChildren(): void {
super.createChildren();
egret.registerImplementation("eui.IAssetAdapter", new AssetAdapter());
egret.registerImplementation("eui.IThemeAdapter", new ThemeAdapter());
this.runGame().catch(e => {
console.log(e);
})
}
private async runGame() {
await this.loadResource();
this.createGameScene();
}
private async loadResource() {
try {
egret.ImageLoader.crossOrigin = "anonymous";
const resBasePath = window['resPath'] || '';
await RES.loadConfig("default.res.json", resBasePath + "resource/");
await this.loadTheme();
let loadingView = LoadingView.instance;
this.addChild(loadingView);
await RES.loadGroup("common", 0, loadingView);
}
catch (e) {
console.error(e);
}
}
private loadTheme() {
return new Promise((resolve, reject) => {
let theme = new eui.Theme("resource/default.thm.json", this.stage);
theme.addEventListener(eui.UIEvent.COMPLETE, () => {
resolve();
}, this);
})
}
/**
* 创建场景界面
* Create scene interface
*/
protected createGameScene(): void {
let mainStage:MainStage = MainStage.instance;
this.addChildAt(mainStage, 0);
}
}
......@@ -4,20 +4,17 @@
* 主舞台
*/
import Service from "../services/Service";
import LoadingView from "./LoadingView";
import GameConfig from "../model/GameConfig";
import {PopUpManager} from "@alienlib/popup";
import lang from "../lang";
import {gameInfo} from "../model/data-center";
import {Dispatcher} from "@alienlib/support";
import {SCENE_FINAL_REWARD, SCENE_MENU, SCENE_PLAY} from "../model/constants";
import {catchError} from "../Utils";
import {ready as readyCurseManager} from "../curse/Manager";
import SceneController from "./SceneController";
import PanelController from "./PanelController";
import Service from "./Service";
import LoadingView from "./view/LoadingView";
import lang from "./lang";
import {catchError} from "./ErrorUtils";
import {ready as readyCurseManager} from "./curse/Manager";
import SceneController from "./view/SceneController";
import PanelController from "./view/PanelController";
import Toast from "./view/Toast";
import {getTweenPromise} from "@alienlib/tools/EgretUtils";
import Toast from "./Toast";
import {Dispatcher} from "@alienlib/support";
Toast;
......@@ -51,8 +48,6 @@ export default class MainStage extends eui.Component {
protected init() {
lang.initData();
GameConfig.initData();
this.projectConfig = RES.getRes('project-config');
this.services = this.projectConfig.settings.services.map(item => {
return window[item + 'Service'];
......@@ -99,11 +94,6 @@ export default class MainStage extends eui.Component {
}
}
clearAndGotoScene(sceneName, params = null) {
PopUpManager.removeAllPupUp();
SceneController.popAll(sceneName, params);
}
showBlackLayer(event) {
const p = event.data;
......@@ -142,21 +132,10 @@ export default class MainStage extends eui.Component {
async start(params = null) {
await Promise.all(this.services.map(service => service.start()));
const code = gameInfo.statusCode;
const sceneName = code == 4 || code == 5 ? SCENE_FINAL_REWARD :
SCENE_MENU;
this.clearAndGotoScene(sceneName, params)
this.services.forEach(service => service.afterStart())
}
async stop() {
return Promise.all(this.services.map(service => service.stop()))
.then(
(data) => {
},
(error) => {
}
);
return Promise.all(this.services.map(service => service.stop()));
}
}
......@@ -32,4 +32,8 @@ export default class Service extends egret.EventDispatcher{
async stop(){
eventManager.disable(this.eventGroupName);
}
afterStart(){
}
}
\ No newline at end of file
......@@ -3,9 +3,11 @@
*
* 网络服务
*/
import GameConfig from "../model/GameConfig";
import {Ajax, EgretUtils} from "@alienlib/tools";
const WEB_SERVICE_URL: string = DEBUG ? 'http://localhost:3000' : '';
class WebService {
/**
* 调用API
......@@ -19,7 +21,7 @@ class WebService {
params = {};
}
let url: string = GameConfig.WEB_SERVICE_URL + uri;
let url: string = WEB_SERVICE_URL + uri;
let m: Function = method == 'post' ? Ajax.POST : Ajax.GET;
......
/**
* Created by rockyl on 2017/12/21.
*/
declare function devil(t);
/**
* Created by rockyl on 2018/9/12.
*/
import Language from "./model/Language";
const lang: Language = new Language();
......
......@@ -2,7 +2,7 @@
* Created by admin on 2017/6/30.
*/
import {StringUtils, Utils} from "@alienlib/tools";
import {LanguageIds, LanguagePack} from "./LanguagePack";
import {LanguageIds, LanguagePack} from "../../generated/LanguagePack";
export default class Language extends LanguagePack{
public ids:LanguageIds;
......
/**
* Created by rocky.l on 2017/2/8.
*
* 事件名
*/
export const SHOW_TOAST: string = 'SHOW_TOAST';
export const HIDE_TOAST: string = 'HIDE_TOAST';
\ No newline at end of file
/**
* Created by rockyl on 2018/8/21.
*/
export function delayLoad(){
}
......@@ -4,7 +4,7 @@
* 角标
*/
import CurseComponent from "../curse/CurseComponent";
import CurseComponent from "../../core/curse/CurseComponent";
import badgeService from "../services/BadgeService";
import {BADGE_CHANGED} from "../model/events";
......
......@@ -2,7 +2,7 @@
* Created by rockyl on 2018/10/10.
*/
import CurseComponent from "../curse/CurseComponent";
import CurseComponent from "../../core/curse/CurseComponent";
import {breath, Wave} from "@alienlib/animation/wave";
import {anchorCenter} from "@alienlib/tools/Utils";
......
......@@ -2,7 +2,7 @@
* Created by rockyl on 2018/10/10.
*/
import CurseComponent from "../curse/CurseComponent";
import CurseComponent from "../../core/curse/CurseComponent";
import buriedPointService from "../services/BuriedPointService";
export default class BuriedPointButton extends CurseComponent {
......
......@@ -2,8 +2,8 @@
* Created by rockyl on 2018/10/10.
*/
import CurseComponent from "../curse/CurseComponent";
import SceneController from "../views/SceneController";
import CurseComponent from "../../core/curse/CurseComponent";
import SceneController from "../../core/view/SceneController";
export default class ButtonBack extends CurseComponent{
type: number;
......
......@@ -2,9 +2,9 @@
* Created by rockyl on 2018/10/10.
*/
import CurseComponent from "../curse/CurseComponent";
import PanelController from "../views/PanelController";
import CurseComponent from "../../core/curse/CurseComponent";
import {PANEL_RULE} from "../model/constants";
import PanelController from "../../core/view/PanelController";
export default class ButtonRule extends CurseComponent{
type: number;
......
......@@ -2,9 +2,9 @@
* Created by rockyl on 2018/10/10.
*/
import CurseComponent from "../curse/CurseComponent";
import SceneController from "../views/SceneController";
import CurseComponent from "../../core/curse/CurseComponent";
import {SCENE_PLAY} from "../model/constants";
import SceneController from "../../core/view/SceneController";
export default class ButtonStart extends CurseComponent{
type: number;
......
......@@ -4,7 +4,7 @@
*
*/
import CurseComponent from "../curse/CurseComponent";
import CurseComponent from "../../core/curse/CurseComponent";
export default class GameViewLabel extends CurseComponent {
protected reset() {
......
......@@ -4,9 +4,9 @@
* 规则弹窗
*/
import CurseComponent from "../curse/CurseComponent";
import PanelController from "../views/PanelController";
import CurseComponent from "../../core/curse/CurseComponent";
import {PANEL_RULE} from "../model/constants";
import PanelController from "../../core/view/PanelController";
export default class PanelRule extends CurseComponent {
content: string;
......@@ -15,8 +15,6 @@ export default class PanelRule extends CurseComponent {
protected reset() {
super.reset();
console.log(this.content);
const {labContent, btnConfirm} = this.host;
labContent.text= this.content;
btnConfirm.label = this.button;
......
......@@ -2,7 +2,7 @@
* Created by rockyl on 2018/10/10.
*/
import CurseComponent from "../curse/CurseComponent";
import CurseComponent from "../../core/curse/CurseComponent";
import {sin, Wave} from "@alienlib/animation/wave";
import {delayLoad} from "../Utils";
......
......@@ -2,7 +2,7 @@
* Created by rockyl on 2018/10/10.
*/
import CurseComponent from "../curse/CurseComponent";
import CurseComponent from "../../core/curse/CurseComponent";
import {delayLoad} from "../Utils";
import defenseService from "../services/DefenseService";
......
/**
* Created by rockyl on 2017/12/21.
*/
declare const recordUrl: string;
declare const resPath: string;
......@@ -5,16 +5,12 @@
*/
export default class GameConfig extends egret.HashObject {
static WEB_SERVICE_URL: string = DEBUG ? 'http://localhost:3000' : '';
static gameName: string = 'curse';
static gameName: string = '{projectName}';
static gameConfig: any = {};
static appConfig: any = {};
static defenseConfig: any = {};
static factor = 10;
static parseConfig() {
const {gameInfo, appInfo, defenseStrategy} = window['CFG'];
const {gameConfig, appConfig, defenseConfig} = this;
......
/**
* Created by rockyl on 2018/8/21.
*/
export default class GameInfo{
data:any;
creditUnit;
update(data){
this.data = data;
this.data.oldMaxScore = this.data ? this.maxScore : 0;
}
get statusCode(){
return this.data.status.code;
}
get maxScore(){
return this.data.maxScore || 0;
}
get percentage(){
return this.data.percentage;
}
get credits(){
return this.data.credits;
}
get status(){
return this.data.status;
}
get gameId(){
return this.data.gameId;
}
get consumerId(){
return this.data.consumerId;
}
}
......@@ -11,7 +11,4 @@ export const SCENE_MISSION:string = 'scene_mission';
export const SCENE_DRAW_REWARD:string = 'scene_draw-reward';
export const SCENE_FINAL_REWARD:string = 'scene_final_reward';
export const PANEL_RULE:string = 'panel_rule';
export const BADGE_ITEM_COUNT:string = 'BADGE_ITEM_COUNT';
export const BADGE_DRAW_REWARD_COUNT:string = 'BADGE_DRAW_REWARD_COUNT';
\ No newline at end of file
export const PANEL_RULE:string = 'panel_rule';
\ No newline at end of file
/**
* Created by rockyl on 2018/9/12.
*
* 数据中心
*/
import GameInfo from "./GameInfo";
export const gameInfo: GameInfo = new GameInfo();
export const authData: any = {};
export const pluginInfos = {};
/**
* Created by rocky.l on 2017/2/8.
*
* 事件名
*/
export const BADGE_CHANGED: string = 'BADGE_CHANGED';
export const SETTING_CHANGED: string = 'SETTING_CHANGED';
\ No newline at end of file
......@@ -4,11 +4,11 @@
* api
*/
import webService from "./WebService";
import GameConfig from "../model/GameConfig";
import {authData, gameInfo, pluginInfos} from "../model/data-center";
import {injectProp} from "@alienlib/tools/Utils";
import {md5} from "@alienlib/tools/md5";
import webService from "../../core/WebService";
import {gameInfo} from "../model/data-center";
import GameConfig from "../model/GameConfig";
export async function getToken() {
return new Promise((resolve, reject) => {
......
/**
* Created by rockyl on 2018/8/23.
*
* 任务服务
*/
import {BADGE_CHANGED} from "../model/events";
import Service from "../../core/Service";
class BadgeService extends Service {
items: any;
async start(): Promise<void> {
await super.start();
this.items = {};
}
private getItem(name){
let item = this.items[name];
if(!item){
item = this.items[name] = {
number: 0,
};
}
return item;
}
private updateItem(name, item, number){
item.number = number;
this.dispatchEventWith(BADGE_CHANGED, false, {name, number})
}
update(name, number){
const item = this.getItem(name);
this.updateItem(name, item, number);
}
change(name, number){
const item = this.getItem(name);
this.updateItem(name, item, item.number + number);
}
getNumber(name){
const item = this.getItem(name);
return item.number;
}
}
const badgeService: BadgeService = new BadgeService();
export default badgeService;
/**
* Created by rockyl on 2018/9/29.
*
* 埋点服务
*/
import Service from "../../core/Service";
import GameConfig from "../model/GameConfig";
import {JSONP} from "@alienlib/tools/Ajax";
import BuriedPoint from "../net/BuriedPoint";
import {gameInfo} from "../model/data-center";
import webService from "../../core/WebService";
class BuriedPointService extends Service {
private _buriedPoints: any = {};
env: any;
async start(): Promise<void> {
await super.start();
this.initEnv();
}
initEnv(){
this.env = {
app_id: GameConfig.appConfig.appId,
oaid: GameConfig.gameConfig.oaId,
}
}
addBuriedPoints(buriedPoints) {
for (let name in buriedPoints) {
this._buriedPoints[name] = buriedPoints[name];
}
}
addBuriedPointConfig(name, config) {
const {dpm, dcm} = config;
this._buriedPoints[name] = new BuriedPoint(dpm, dcm, this.env);
}
addBuriedPointConfigs(configs) {
for (let name in configs) {
this.addBuriedPointConfig(name, configs[name]);
}
}
logExposure(name) {
return this.log(name, 'exposure');
}
logClick(name) {
return this.log(name, 'click');
}
log(name, type) {
let logPoint = this._buriedPoints[name];
let {consumerId} = gameInfo;
let {appId} = GameConfig.appConfig;
let {dpm, dcm} = logPoint;
if (type == 'exposure') {
return JSONP('//embedlog.duiba.com.cn/exposure/standard', {
dpm, dcm, consumerId, appId,
}, 'get').catch(e => {
//console.log(e);
});
} else {
return webService.callApi(
'/log/click',
{
dpm, dcm, consumerId, appId
},
'get'
).catch(e => {
//console.log(e);
});
}
}
}
const buriedPointService: BuriedPointService = new BuriedPointService();
export default buriedPointService;
/**
* Created by rockyl on 2018/8/23.
*/
import Service from "../../core/Service";
import GameConfig from "../model/GameConfig";
import * as api from "../net/api";
class DefenseService extends Service {
collection: any[] = [];
strategyCollection: any[] = [];
pashCount;
setView(view){
this.registerEvent(view, egret.TouchEvent.TOUCH_BEGIN, this.onTouch.bind(this, 'md'), this);
}
reset() {
this.collection.splice(0);
this.strategyCollection.splice(0);
this.pashCount = 0;
}
private onTouch(type, e:egret.TouchEvent){
const data = { a: type, t: Date.now(), x: e.stageX, y: e.stageY };
/*let str = JSON.stringify(data);
str = md5(str);
let result = '';
for(let i = 0, li = str.length; i < li; i++){
result += Math.random() < 0.3 ? str.charAt(i) : '';
}*/
this.strategyCollection.push(data)
}
scoreChanged(score){
const {interfaceLimit, scoreUnit} = GameConfig.defenseConfig;
const nextDatapashScore = score - this.pashCount * scoreUnit;
if (scoreUnit == 0 || nextDatapashScore < scoreUnit || this.pashCount > interfaceLimit) {
return;
}
this.collection.push(this.strategyCollection.concat());
api.datapash(this.strategyCollection);
this.strategyCollection.splice(0);
this.pashCount++;
}
close(){
this.collection.push(this.strategyCollection.concat());
return {
strategyCollection: this.strategyCollection,
collection: this.collection,
}
}
}
const defenseService: DefenseService = new DefenseService();
export default defenseService;
\ No newline at end of file
/**
* Created by admin on 2017/6/26.
*
* 主服务
*/
import GameConfig from "../model/GameConfig";
import Service from "../../core/Service";
import * as api from '../net/api'
import {gameInfo} from "../model/data-center";
import {SCENE_FINAL_REWARD, SCENE_MENU} from "../model/constants";
import {PopUpManager} from "@alienlib/popup";
import SceneController from "../../core/view/SceneController";
class MainService extends Service {
async start() {
GameConfig.parseConfig();
await super.start();
await Promise.all([
api.getInfo(),
//api.getCredits(),
//api.getPrizeInfo(drawPluginId),
//api.plugDrawInfo(drawPluginId),
])
}
afterStart() {
const code = gameInfo.statusCode;
const sceneName = code == 4 || code == 5 ? SCENE_FINAL_REWARD :
SCENE_MENU;
PopUpManager.removeAllPupUp();
SceneController.popAll(sceneName);
}
}
const mainService: MainService = new MainService();
export default mainService
/**
* Created by admin on 2017/6/16.
*
* 存储数据服务
*/
import Service from "../../core/Service";
import {LocalStorage} from "@alienlib/support";
import {SETTING_CHANGED} from "../model/events";
class StorageService extends Service{
protected store:any;
protected _initialized;
start(): Promise<any> {
this.load();
this.store.launch_count = this.store.launch_count ? this.store.launch_count + 1 : 1;
this.save();
return super.start();
}
private load(){
this.store = LocalStorage.getItemObj('store', {});
}
save(){
LocalStorage.setItemObj('store', this.store);
}
clean(keeps = null){
if(keeps){
for(let k in this.store){
if(keeps.indexOf(k) < 0 && this.store.hasOwnProperty(k)){
delete this.store[k];
}
}
}else{
this.store = {};
}
this.save();
this._initialized = false;
}
get launchCount(){
return this.store.launch_count;
}
getSettingItem(field){
return this.store.setting ? (this.store.setting[field] === undefined ? true : this.store.setting[field]) : true;
}
setSettingItem(field, value, dispatch = true){
let setting = this.store.setting;
if(!setting){
setting = this.store.setting = {};
}
setting[field] = value;
this.save();
if(dispatch){
this.dispatchEventWith(SETTING_CHANGED, false, {field, value});
}
}
switchSettingItem(field, dispatch = true){
this.setSettingItem(field, !this.getSettingItem(field), dispatch);
}
}
const storageService:StorageService = new StorageService();
export default storageService;
\ No newline at end of file
export class LanguagePack{
need_login:string;
net_error:string;
current_score:string;
max_score:string;
score_unit:string;
free:string;
my_credit:string;
no_more_credits:string;
revive_cost:string;
revive_failed:string;
rank_first:string;
rank_second:string;
rank_third:string;
rank_num:string;
rank_out:string;
me:string;
rank_max_score:string;
rank_reward_content:string;
no_more_items:string;
need_install_app:string;
share_result:any;
}
export class LanguageIds{
need_login:string = 'need_login';
net_error:string = 'net_error';
current_score:string = 'current_score';
max_score:string = 'max_score';
score_unit:string = 'score_unit';
free:string = 'free';
my_credit:string = 'my_credit';
no_more_credits:string = 'no_more_credits';
revive_cost:string = 'revive_cost';
revive_failed:string = 'revive_failed';
rank_first:string = 'rank_first';
rank_second:string = 'rank_second';
rank_third:string = 'rank_third';
rank_num:string = 'rank_num';
rank_out:string = 'rank_out';
me:string = 'me';
rank_max_score:string = 'rank_max_score';
rank_reward_content:string = 'rank_reward_content';
no_more_items:string = 'no_more_items';
need_install_app:string = 'need_install_app';
share_result:string = 'share_result';
}
\ No newline at end of file
/**
* THIS FILE WAS GENERATE BY COMPILER
* DO NOT MODIFY THIS FILE
*/
import '../game/services/StorageService'
import '../game/services/MainService'
import '../game/services/DefenseService'
import '../game/services/BuriedPointService'
import '../game/services/BadgeService'
import '../game/components/SceneMenu'
import '../game/components/Badge'
import '../game/components/ButtonStart'
import '../game/components/BuriedPointButton'
import '../game/components/Breath'
import '../game/components/ButtonRule'
import '../game/components/BuriedPointButton'
import '../game/components/ScenePlay'
import '../game/components/ButtonBack'
import '../game/components/GameViewLabel'
import '../game/components/PanelRule'
/**
* Created by rockyl on 2017/12/21.
*/
declare const recordUrl: string;
declare const resPath: string;
declare const revivePluginId: number;
declare const drawPluginId: number;
declare function getDuibaToken(success: Function, failed: Function);
declare function devil(t);
declare const shareCfg: any;
declare module AS{
export function ready();
/**
* 用户相关接口,如登录,退出等
*
* @namespace AS.account
*/
namespace account{
function getInfo();
function logout();
function receiveAward();
function softFavorites();
function toLogin(success?, fail?);
function preferenceChannelSign();
}
/**
* APP能力相关接口,如app下载,安装等
*
* @namespace AS.app
*/
namespace app{
function appCallbackRegister();
function cancelDownload();
function downloadApp(option, callback?: Function);
function downloadFile();
function getAppInfo();
function getAppState(packageName, versionCode):string;
function installApp();
function launchApp(packageName);
function linkTo();
function pauseAppDownload();
function updateApp();
function uninstallApp();
function showGuidePopup();
function upgradeToMainAppSearch();
function getInstalledAppList();
}
/**
* 分享到其他社交平台接口,如微博,微信等
*
* @namespace AS.share
*/
namespace share{
function setData(data, callback, type?);
function showTitleBarShare();
function showTitleBarDownload();
}
/**
* 手机系统能力调用接口,如相册、摄像头、电话短信等
*
* @namespace AS.sys
*/
namespace sys{
function openAlbum();
function openCamera();
function openMap();
function openSendMail();
function openSendSMS();
function sendSMS();
function openCallTel();
function callTel();
function checkCreateShortcut();
function addShortcut();
function deleteShortcut();
function isSupportGyroscopeSensor();
function detectGyroscopeSensor();
function cancelDetectGyroscopeSensor();
function getMaxVolume();
function getVolume();
function setVolume();
function detectVoiceLevel();
function cancelVoiceLevel();
function addCalendarRemind();
function copy();
function isAndroidEmulator();
function finishActivity();
function quitDialogRegister();
}
/**
* 高级功能接口,intent相关
*
* @namespace AS.bridge
*/
namespace bridge{
function startActivityIntent();
function startBroadcastIntent();
function startServiceIntent();
}
/**
* 支付功能接口,如发起支付、获取支付用户信息
*
* @namespace AS.pay
*/
namespace pay{
function getPaymentUser();
function sendPayment();
}
}
\ No newline at end of file
/**
* Created by rocky.l on 2017/2/8.
*
* 事件名
*/
export const SETTING_CHANGED: string = 'SETTING_CHANGED';
export const SHOW_WAITING: string = 'SHOW_WAITING';
export const HIDE_WAITING: string = 'HIDE_WAITING';
export const SHOW_TOAST: string = 'SHOW_TOAST';
export const HIDE_TOAST: string = 'HIDE_TOAST';
export const SCORE_CHANGE: string = 'SCORE_CHANGE';
export const BADGE_CHANGED: string = 'BADGE_CHANGED';
\ No newline at end of file
......@@ -6,7 +6,8 @@ exports.replaces = {
},
contentInFiles: [
'index.html',
'project.json'
'project.json',
'game/model/GameConfig.ts'
],
nameOfFiles: []
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment