----

Block

GridMapData = new Map;
GridMapData.set("001x001", 0); // initialize Map

[ initLockData with GridMap %0 ]      :  Lock Room -> When Success -> Send Init Data

var GridMap:Map<String,Dynamic>=new Map<String,Dynamic>();


----
LogicMap = new Map;

Blocks:
[playerpos]
[playervalue]
[direction]
[ for rule name [ %0 ] add [ %1 ] ]
[ if [ get [ %0 ] = [ %1 ] ] ]
[ if [ get [ %0 ] in list [ %1 ] ] ]
[ set [ variable [ %0 ] to [ %1 ] ] ]
[ set [ %0 ] to [ %1 ]  ]
[ get variable [ %0 ] ] 


variable playervalue; (comes from block [do move] )
var playerpos = for each key in gridmap.keys ; if gridmap.get(key) == playervalue : playerpos = key;


[for rule name [ rule1 ] add [ if [ get [ [playerpos] + [direction] ] ] = [0] ] 
[for rule name [ rule1 ] add [ set [ [playerpos] ] to [ 0 ] ] ]
[for rule name [ rule1 ] add [ set [ [playerpos] + [direction] ] to [ [playervalue] ] 

[ for rule name [ rule2 ] add [ if [ get [ [playerpos] + [direction] ] in list [objectlist] ] ]
[ for rule name [ rule2 ] add [ set [ variable [objectval]]  to get [[playerpos]+[direction]] ] ]
[ for rule name [ rule2 ] add [ set [ playerpos ] to [ 0 ] ] ]
[ for rule name [ rule2 ] add [ set [ [playerpos] + [direction] ] to [playervalue] ] ]
[ for rule name [ rule2 ] add [ set [ [playerpos]+[direction]+[direction]] to [variable [objectval]]

----

Results in condition map:
if(move) check condition: local on client if values are so that we can send move request ..


----

Block: 

do move with rules for playervalue: %0 and direction: %1

Code:
* use condintionmap
* if canMove
*	 set canMove false
*	 lockrequest for all set - values 
*		 if lockrequest received send the data value (but do not send to players )
*			 unlockrequest
* 			 if unlockrequest received 
* 				send post to all players  ( the server sends data that is going to ' with lockdata do  '  
                * postdata : changenr ++  for each moveaction : moveactondata=""+changenr+""+current_old_value+","+moveaction[i]+";" endfor send changenr data
* 				set canMove true
*         	  else (after 1 sec no unlockrequest)
*               set canMove true
*        else
*          after 1 sec no lockrequest
*             set canMove true
* if no move is allowed ignore the move request ...
----

Block:

on LockData fill ChangeMapData and do [  ///  internal check for all ;-splitted data if the currentvalue matches the server-oldvalue .. if all is well .. send the data to the player )
 // extension user needs to implement:
   for all changemapdata do 
      display action 
      if data is from active player : allow new input
    if(wait for own input && timeout > 1000){ timeout=0;  allow new input; } 
] wrapper block


----



 