package com.qy.utils;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.Map;


public class WorldTools {

	public static void start(String packName, String managename,Map<String,String> functions) {
		try {
			BufferedReader reader=new BufferedReader(new InputStreamReader(new FileInputStream(new File("data"+File.separator+"接入文档.txt")), "UTF-8"));
			String str="",tmp;
			while ((tmp=reader.readLine())!=null) {
				tmp=tmp.replace("${GameSDK}", managename);
				tmp=tmp.replace("${init}", functions.get("init"));
				tmp=tmp.replace("${pay}", functions.get("pay"));
				tmp=tmp.replace("${getTextAlpha}", functions.get("getTextAlpha"));
				tmp=tmp.replace("${getPermission}", functions.get("getPermission"));
				tmp=tmp.replace("${authority}", functions.get("authority"));
				tmp=tmp.replace("${getSDKManage}", functions.get("getSDKManage"));
				str+=tmp+"\n";
			}
			FileWriter writer=new FileWriter(new File("文档.txt"));
			writer.write(str);
			writer.flush();
			writer.close();
			reader.close();
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
	}
}
