Exemple #1
0
    private short defineStatus(VehicleXmlParser parser)
    {
        if (parser.hasOnlyOneTurret())
            return ONLY_ONE_TURRET;

        /**
         * Some britain SPGs has absolutely two equal turrets but one of them is not used by WG interface.
         * WG screwed up again.
         * Ignore this turret.
         * 
         * As for 10 aug 2013 the screwed SPGs are:
         * gb27_sexton, amx_ob_am105, gb77_fv304, su14_1, gb29_crusader_5inch
         */
        if (parser.turretsHasEqualHP())
            return ONLY_ONE_TURRET;

        if (parser.turretUnlocksSomething())
        {
            XmlNodeList unlocks = parser.getSecondTurretUnlocks();
            List<XmlNode> guns = parser.separateGuns(unlocks);
            int maxUnlockedGunCost = parser.mostExpensive(guns);
            int chassisCost = parser.getChassisCost();
            return unlockedGunIsTotalCrap(maxUnlockedGunCost, chassisCost);
        }

        return STOCK_TURRET_TOP_GUN_POSSIBLE;
    }
Exemple #2
0
    /*
     * Tanks are subset of Vehicles.
     * Tanks has turrets rotation and are subject of interest.
     */

    public Vehicle(XmlNode vdata)
    {
        VehicleXmlParser parser = new VehicleXmlParser(vdata);
        hpstock = parser.getHpStock();
        hptop = parser.getHpTop();
        status = defineStatus(parser);
    }