bshmaploader.java

来自「一个JAVA程序员的游戏」· Java 代码 · 共 40 行

JAVA
40
字号
/*
 * BshMapLoader.java
 *
 * Created on 3. Januar 2007, 21:58
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package kanjitori.map;

import bsh.Interpreter;
import kanjitori.map.Map;
import kanjitori.map.MapLoader;

/**
 *
 * @author Pirx
 */
public class BshMapLoader implements MapLoader {
    
   
    /** Creates a new instance of BshMapLoader */
    public BshMapLoader() {
        
    }
 
    public Map load(String mapFileName) {
        try {
            Interpreter i = new Interpreter();
            i.source(mapFileName);
            return (Map) i.get("map");
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return null;
    }    
    
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?