Search in sources :

Example 1 with BaseVO

use of com.cas.util.vo.BaseVO in project TeachingInSimulation by ScOrPiOzzy.

the class ValveLogic method changeBlockState.

private void changeBlockState(String oldId, String newId) {
    BlockState oldBlock = def.getBlockStatesMap().get(oldId);
    if (oldBlock != null) {
        List<BaseVO<?>> oldBlockList = oldBlock.getChildren();
        for (BaseVO<?> baseVO : oldBlockList) {
            if (baseVO instanceof BlockRelation) {
                BlockRelation relation = (BlockRelation) baseVO;
                def.blockRelationRemoved(relation);
                G.g().refreshGasPressure();
            }
        }
    }
    BlockState newBlock = def.getBlockStatesMap().get(newId);
    if (newBlock != null) {
        List<BaseVO<?>> newBlockList = newBlock.getChildren();
        for (BaseVO<?> baseVO : newBlockList) {
            if (baseVO instanceof BlockRelation) {
                BlockRelation relation = (BlockRelation) baseVO;
                def.blockRelationAdded(relation);
                G.g().refreshGasPressure();
            }
        }
    }
}
Also used : BlockState(com.cas.gas.vo.BlockState) BaseVO(com.cas.util.vo.BaseVO) BlockRelation(com.cas.gas.vo.BlockRelation)

Example 2 with BaseVO

use of com.cas.util.vo.BaseVO in project TeachingInSimulation by ScOrPiOzzy.

the class ValveLogicEx method changeBlockState.

private void changeBlockState(String oldId, String newId) {
    BlockState oldBlock = def.getBlockStatesMap().get(oldId);
    if (oldBlock != null) {
        List<BaseVO<?>> oldBlockList = oldBlock.getChildren();
        for (BaseVO<?> baseVO : oldBlockList) {
            if (baseVO instanceof BlockRelation) {
                BlockRelation relation = (BlockRelation) baseVO;
                def.blockRelationRemoved(relation);
                G.g().refreshGasPressure();
            }
        }
    }
    BlockState newBlock = def.getBlockStatesMap().get(newId);
    if (newBlock != null) {
        List<BaseVO<?>> newBlockList = newBlock.getChildren();
        for (BaseVO<?> baseVO : newBlockList) {
            if (baseVO instanceof BlockRelation) {
                BlockRelation relation = (BlockRelation) baseVO;
                def.blockRelationAdded(relation);
                G.g().refreshGasPressure();
            }
        }
    }
}
Also used : BlockState(com.cas.gas.vo.BlockState) BaseVO(com.cas.util.vo.BaseVO) BlockRelation(com.cas.gas.vo.BlockRelation)

Aggregations

BlockRelation (com.cas.gas.vo.BlockRelation)2 BlockState (com.cas.gas.vo.BlockState)2 BaseVO (com.cas.util.vo.BaseVO)2