loadDevicesFromFile() публичный Метод

public loadDevicesFromFile ( string filePath ) : LinkedList
filePath string
Результат LinkedList
Пример #1
0
    // Warning: loads from inputFiles is an array of names of files inside 'biobrickFilesPathPrefix'
    void loadDevices()
    {
        LinkedList <BioBrick> availableBioBricks = AvailableBioBricksManager.get().getAvailableBioBricks();
        LinkedList <BioBrick> allBioBricks       = AvailableBioBricksManager.get().getAllBioBricks();

        LevelInfo levelInfo = null;

        MemoryManager.get().tryGetCurrentLevelInfo(out levelInfo);

        List <Device> devices = new List <Device>();

        DeviceLoader dLoader = new DeviceLoader(availableBioBricks, allBioBricks);

        string[] filesToLoad;
        string   currentMapDevicesFilePath = MemoryManager.get().configuration.getGameMapName();

        if (null == levelInfo || !levelInfo.areAllDevicesAvailable)
        {
            filesToLoad = new string[] { currentMapDevicesFilePath };
        }
        else
        {
            List <string> fileList = new List <string>(deviceFiles);
            fileList.Add(currentMapDevicesFilePath);
            filesToLoad = fileList.ToArray();
        }
        foreach (string file in filesToLoad)
        {
            string fullPathFile = deviceFilesPathPrefix + file;
            Logger.Log("Inventory::loadDevices loads device file " + fullPathFile, Logger.Level.TRACE);
            devices.AddRange(dLoader.loadDevicesFromFile(fullPathFile));
        }
        UpdateData(devices, new List <Device>(), new List <Device>());
    }
Пример #2
0
    // Warning: loads from inputFiles is an array of names of files inside 'biobrickFilesPathPrefix'
    void loadDevices()
    {
        LinkedList<BioBrick> availableBioBricks = AvailableBioBricksManager.get().getAvailableBioBricks();
        LinkedList<BioBrick> allBioBricks = AvailableBioBricksManager.get().getAllBioBricks();

        LevelInfo levelInfo = null;
        MemoryManager.get().tryGetCurrentLevelInfo(out levelInfo);

        List<Device> devices = new List<Device>();

        DeviceLoader dLoader = new DeviceLoader(availableBioBricks, allBioBricks);

        string[] filesToLoad;
        string currentMapDevicesFilePath = MemoryManager.get().configuration.getGameMapName();

        if (null == levelInfo || !levelInfo.areAllDevicesAvailable)
        {
            filesToLoad = new string[] { currentMapDevicesFilePath };
        }
        else
        {
            List<string> fileList = new List<string>(deviceFiles);
            fileList.Add(currentMapDevicesFilePath);
            filesToLoad = fileList.ToArray();
        }
        foreach (string file in filesToLoad)
        {
            string fullPathFile = deviceFilesPathPrefix + file;
            Logger.Log("Inventory::loadDevices loads device file " + fullPathFile, Logger.Level.TRACE);
            devices.AddRange(dLoader.loadDevicesFromFile(fullPathFile));
        }
        UpdateData(devices, new List<Device>(), new List<Device>());
    }