from ParseTs import ParseTs


class ParseTsS(ParseTs):
    # def __init__(self, xls_full_path, code_dest_path, cfg_dest_path):
    #     super(
    #         ParseTsS,
    #         self).__init__(
    #         xls_full_path,
    #         code_dest_path,
    #         cfg_dest_path)

    def _get_game_class_templet_str(self):
        return '''/*
* Copyright 2017
* This file is automatically generated by python script
* The data is from @SrTb
*/

@EsIpDc#
import { @ClassNm } from './@PkgDfNm/@ClassNm';

export class @ClassNm{
    @PtDc#
    public @PtNm:@PtTp;@VtDc@PtTp[]

    public constructor(data:any){
        @PrSt#
        this.@PtNm = data.@PrFc;
        @MpLnFmBg:this.@PtNm = [];
        for(let i = data.readUnsignedByte()-1; i>=0; --i){
            let child:@PtTp = new @PtTp(data);
            this.@PtNm.push(child);
        }@MpLnFmEd#
        @MpLnFmBg:this.@PtNm = [];
        for(let i = data.readUnsignedByte()-1; i>=0; --i){
            this.@PtNm.push(data.@PrFc);
        }@MpLnFmEd#
        @MpLnFmBg:this.@PtNm = [];
        for(let i = data.readUnsignedByte()-1; i>=0; --i){
            let tempList = [];
            this.@PtNm.push(tempList);
            for(let j = data.readUnsignedByte()-1; j>=0; --j){
                tempList.push(data.@PrFc);
            }
        }@MpLnFmEd#
    }
}
'''

    def _get_define_class_templet_str(self):
        return '''/*
* Copyright 2017
* This file is automatically generated by python script
*/

export class @ClassNm{
    @PtDc#
    public @PtNm:@PtTp;

    public constructor(data:any){
        @PrSt#
        this.@PtNm = data.@PrFc;
    }
}
'''

    def _get_class_collection_templet_str(self):
        return '''/*
* Copyright 2017
* This file is automatically generated by python script
*/

@EsIpDc#
import { @ClassNm } from "./@ClassNm";

export class @ClassNm{
    @ClDc#
    public static @ClassNm = @ClassNm;

    @PtDc#
    public static map@ClassNm:Map<number, @ClassNm> = new Map<number, @ClassNm>();
}

@EsEpDc#
export function static@PtTp(value:number):@PtTp{ return @ClassNm.map@PtTp.get(value);}
'''
