String[] children = dir.list();
for (int i = 0; i < children.length; ++i) {
Debug.p(children[i], 5);
ConfigReader conf = new ConfigReader(pathToWeapons + "/" + children[i] + "/weapon.ini");
Weapon newW = new Weapon();
newW.directory = pathToWeapons + "/" + children[i];
//könnte man noch die bilder für die animationen reinladen
newW.name = conf.getString("name");
newW.type = WeaponTypes.valueOf(conf.getString("type"));
newW.power = conf.getInt("power");
newW.speed = conf.getInt("speed");
newW.range = conf.getInt("range");
newW.defaultAmmo = conf.getInt("defaultAmmo");
newW.costMana = conf.getInt("costMana");
newW.costStamina = conf.getInt("costStamina");
newW.explosion = conf.getBool("explosion");
newW.explosionRange = conf.getInt("explosionRange");
newW.animationFrames = conf.getValues("animationFrames");
newW.explosionFrames = conf.getValues("explosionFrames");
newW.shootingFrames = conf.getValues("shootingFrames");
weapons.add(newW);
}
}