package com.tsi.navi;

import android.app.Application;

import com.tsi.navi.util.TsiDirection;
import com.tsi.navi.vo.MapConfig;
import com.tsi.navi.vo.NodeVo;

import java.util.concurrent.ConcurrentHashMap;

public class TsiNaviApplication extends Application {

    private static TsiNaviApplication instance;
    private static String packageName;
    private static MapConfig mapConfig;
    private static TsiDirection tsiDirection;
    private static ConcurrentHashMap<Long, NodeVo> nodeMap;

    public static TsiNaviApplication getInstance() {
        return instance;
    }
    public static String packageName() {
        return packageName;
    }
    public static MapConfig getMapConfig() {
        return mapConfig;
    }
    public static TsiDirection getDirection() {
        return tsiDirection;
    }
    public static ConcurrentHashMap<Long, NodeVo> getNodeMap() {
        return nodeMap;
    }
    public static NodeVo findNode(long nodeId) {
        return nodeMap.get(nodeId);
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        packageName = getPackageName();
        mapConfig = new MapConfig();
        tsiDirection = new TsiDirection();
        nodeMap = new ConcurrentHashMap<>();
    }

}
