public function setupMoves() { if ($this->flags->ordered) { $this->row_moves = new haxe_ds_IntMap(); $moves = coopy_Mover::moveUnits($this->row_units); $_g1 = 0; $_g = $moves->length; while ($_g1 < $_g) { $i = $_g1++; $this->row_moves->set($moves[$i], $i); $i; unset($i); } $this->col_moves = new haxe_ds_IntMap(); $moves = coopy_Mover::moveUnits($this->column_units); $_g11 = 0; $_g2 = $moves->length; while ($_g11 < $_g2) { $i1 = $_g11++; $this->col_moves->set($moves[$i1], $i1); $i1; unset($i1); } } }
static function move($isrc, $idest) { $len = $isrc->length; $len2 = $idest->length; $in_src = new haxe_ds_IntMap(); $in_dest = new haxe_ds_IntMap(); $_g = 0; while ($_g < $len) { $i = $_g++; $in_src->set($isrc[$i], $i); $i; unset($i); } $_g1 = 0; while ($_g1 < $len2) { $i1 = $_g1++; $in_dest->set($idest[$i1], $i1); $i1; unset($i1); } $src = new _hx_array(array()); $dest = new _hx_array(array()); $v = null; $_g2 = 0; while ($_g2 < $len) { $i2 = $_g2++; $v = $isrc[$i2]; if ($in_dest->exists($v)) { $src->push($v); } unset($i2); } $_g3 = 0; while ($_g3 < $len2) { $i3 = $_g3++; $v = $idest[$i3]; if ($in_src->exists($v)) { $dest->push($v); } unset($i3); } return coopy_Mover::moveWithoutExtras($src, $dest); }