Package transientlibs.bindedobjects.core.loaders

Source Code of transientlibs.bindedobjects.core.loaders.EquipmentSlotsLoader

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package transientlibs.bindedobjects.core.loaders;

import transientlibs.bindedobjects.core.datasets.*;
import java.util.ArrayList;
import transientlibs.slick2d.util.Log;
import transientlibs.bindedobjects.core.Binding;
import transientlibs.bindedobjects.core.datasets.LesserBindedValue;
import transientlibs.tex.StringAnalyst;

/**
*
* @author kibertoad
*/
public class EquipmentSlotsLoader extends LesserBindedValueLoader {

    public String code;
    public int bodyPart;

    public EquipmentSlotsLoader(LesserBindedValueContainer setContainer) {
        super(setContainer);
    }

    public void loadEquipmentSlots() {

        if (StringAnalyst.isFileExist("equipmentslots.dat")) {

            StringAnalyst reader = new StringAnalyst();


            reader.openFile("equipmentslots.dat");

            while (!reader.eof) {


                reader.readRow();
                analyzeString(reader);
            }

            reader.closeFile();
        }
    }

    public EquipmentSlots lastEquipmentSlots() {
        return (EquipmentSlots) container.lastElement;
    }

    @Override
    public boolean analyzeString(String getString, StringAnalyst analyst) {

        if (!"-NO-".equals(getString)) {
            analyst.fullStr = getString;
        }
        analyst.checkForAliases();

        analyst.getNextString();
        String nowStr = analyst.lastStr;

        boolean withResult = false;

        if (nowStr.equals("slot")) {

            container.add(new EquipmentSlots());
            container.getID(analyst);
            lastEquipmentSlots().code = analyst.lastStr;


            //ReqList.lastReqList = lastEquipmentSlots.trainReqs;

            withResult = true;

        }


        if (withResult == false) {
            super.analyzeString(analyst.fullStr, analyst);
        }


        if ((withResult == false) && (nowStr.length() > 2) && (!nowStr.startsWith("//"))) {
            Log.error("Unknown string: " + nowStr);
        }

        return withResult;

    }
}
TOP

Related Classes of transientlibs.bindedobjects.core.loaders.EquipmentSlotsLoader

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.