Package megamek.common.verifier

Examples of megamek.common.verifier.TestEntity


        if (Server.entityVerifier == null) {
            Server.entityVerifier = new EntityVerifier(new File(VERIFIER_CONFIG_FILENAME));
        }
        // we can only test meks and vehicles right now
        if ((entity instanceof Mech) || (entity instanceof Tank)) {
            TestEntity testEntity = null;
            entity.restore();
            if (entity instanceof Mech) {
                testEntity = new TestMech((Mech) entity, Server.entityVerifier.mechOption, null);
            }
            if (entity instanceof VTOL) {
                testEntity = new TestTank((Tank) entity, Server.entityVerifier.tankOption, null);// not
            }
            // implemented
            // yet.
            if (entity instanceof Tank) {
                testEntity = new TestTank((Tank) entity, Server.entityVerifier.tankOption, null);
            }
            StringBuffer sb = new StringBuffer();
            if (testEntity.correctEntity(sb, !game.getOptions().booleanOption("is_eq_limits"))) {
                entity.setDesignValid(true);
            } else {
                System.err.println(sb);
                if (game.getOptions().booleanOption("allow_illegal_units")) {
                    entity.setDesignValid(false);
View Full Code Here


        m_mechView.setEditable(false);
        String readout = mechView.getMechReadout();
        StringBuffer sb = new StringBuffer(readout);
        m_mechView.setText(readout);
        if((entity instanceof Mech) || (entity instanceof Tank)) {
            TestEntity testEntity = null;
            if (entity instanceof Mech) {
                testEntity = new TestMech((Mech)entity, entityVerifier.mechOption, null);
            }
            if (entity instanceof Tank) {
                testEntity = new TestTank((Tank)entity, entityVerifier.tankOption, null);
            }
            if (!testEntity.correctEntity(sb, !m_clientgui.getClient().game.getOptions().booleanOption("is_eq_limits"))) {
                m_mechView.setText(sb.toString());
            }
        }
        m_mechView.setCaretPosition(0);
View Full Code Here

        m_mechView.setEditable(false);
        String readout = mechView.getMechReadout();
        StringBuffer sb = new StringBuffer(readout);
        m_mechView.setText(readout);
        if (entity instanceof Mech || entity instanceof Tank) {
            TestEntity testEntity = null;
            if (entity instanceof Mech)
                testEntity = new TestMech((Mech) entity,
                        entityVerifier.mechOption, null);
            else
                // entity instanceof Tank
                testEntity = new TestTank((Tank) entity,
                        entityVerifier.tankOption, null);
            if (!testEntity.correctEntity(sb, !m_clientgui.getClient().game
                    .getOptions().booleanOption("is_eq_limits"))) {
                m_mechView.setText(sb.toString());
            }
        }
        m_mechView.setCaretPosition(0);
View Full Code Here

        m_mechView.setEditable(false);
        String readout = mechView.getMechReadout();
        StringBuffer sb = new StringBuffer(readout);
        m_mechView.setText(readout);
        if (entity instanceof Mech || entity instanceof Tank) {
            TestEntity testEntity = null;
            if (entity instanceof Mech) {
                testEntity = new TestMech((Mech) entity,
                        entityVerifier.mechOption, null);
            } else {
                // entity instanceof Tank
                testEntity = new TestTank((Tank) entity,
                        entityVerifier.tankOption, null);
            }
            if (!testEntity.correctEntity(sb, !m_clientgui.getClient().game
                    .getOptions().booleanOption("is_eq_limits"))) {
                m_mechView.setText(sb.toString());
            }
        }
        m_mechView.setCaretPosition(0);
View Full Code Here

        ms.setLevel(TechConstants.T_SIMPLE_LEVEL[e.getTechLevel()]);
        ms.setCost((int) e.getCost());
        ms.setCanon(e.isCanon());
        // we can only test meks and vehicles right now
        if ((e instanceof Mech) || (e instanceof Tank)) {
            TestEntity testEntity = null;
            if (e instanceof Mech) {
                testEntity = new TestMech((Mech) e, entityVerifier.mechOption,
                        null);
            } else {
                testEntity = new TestTank((Tank) e, entityVerifier.tankOption,
                        null);
            }
            if (!testEntity.correctEntity(new StringBuffer())) {
                ms.setLevel("F");
            }
        }
        return ms;
    }
View Full Code Here

                                new File(
                                        "data/mechfiles/UnitVerifierOptions.xml"));
                        MechView mechView = new MechView(entity, false);
                        StringBuffer sb = new StringBuffer(mechView.getMechReadout());
                        if ((entity instanceof Mech) || (entity instanceof Tank)) {
                            TestEntity testEntity = null;
                            if (entity instanceof Mech) {
                                testEntity = new TestMech((Mech) entity,entityVerifier.mechOption, null);
                            }
                            if (entity instanceof Tank) {
                                testEntity = new TestTank((Tank) entity,entityVerifier.tankOption, null);
                            }

                            if (testEntity != null) {
                                testEntity.correctEntity(sb, true);
                            }
                        }
                        System.err.println(sb.toString());

                        // new EntityVerifier(new
View Full Code Here

        m_mechView.setEditable(false);
        String readout = mechView.getMechReadout();
        StringBuffer sb = new StringBuffer(readout);
        m_mechView.setText(readout);
        if(entity instanceof Mech || entity instanceof Tank) {
            TestEntity testEntity = null;
            if (entity instanceof Mech) {
                testEntity = new TestMech((Mech)entity, entityVerifier.mechOption, null);
            }
            if (entity instanceof Tank) {
                testEntity = new TestTank((Tank)entity, entityVerifier.tankOption, null);
            }
            if (!testEntity.correctEntity(sb, !m_clientgui.getClient().game.getOptions().booleanOption("is_eq_limits"))) {
                m_mechView.setText(sb.toString());
            }
        }
        m_mechView.setCaretPosition(0);
View Full Code Here

TOP

Related Classes of megamek.common.verifier.TestEntity

Copyright © 2018 www.massapicom. 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.