summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
68792f9)
- These modifications allows the grid to be consistent and coherent
at any time.
@Override
public void updateMappedNode( GNode _dead, GNode _remp )
{
@Override
public void updateMappedNode( GNode _dead, GNode _remp )
{
- int pos = 0 ;
- pos = al.getMapping().getIdOfAssociation( _dead ) ;
-
- if( pos == -1 )
- System.err.println( "GNode "+_dead+" does not exist in the mapping!" ) ;
- return ;
- }
- /** Changing the node in the mapping **/
- al.getMapping().getMapping().get( pos ).setGNode( _remp ) ;
+ pos = al.getMapping().getIdOfAssociation( _dead ) ;
- /** Changing the status in the grid **/
- al.getGrid().setMappedStatus( _remp, true ) ;
-
- System.out.println( "Succesfully replacing the fallen node in the mapping." ) ;
+ if( pos != -1 )
+ {
+ /** Changing the node in the mapping **/
+ al.getMapping().getMapping().get( pos ).setGNode( _remp ) ;
+
+ System.out.println( "Succesfully replacing the fallen node in the mapping." ) ;
+ }
+
+ /** Changing the status in the grid **/
+ al.getGrid().setMappedStatus( _remp, true ) ;
+
+ al.updateGrid() ;
+ } else {
+ System.err.println( "GNode "+_dead+" does not exist in the mapping!" ) ;
+ }