import * as types from '../constants/ActionTypes';
import initialWorld from '../library/initialWorld';

const world = (state = initialWorld(24, 10), action) => {
  switch (action.type) {
  case types.DOWN_BLOCK:
    return state;
  case types.TRANSFORM_BLOCK:
    return state;
  case types.MOVE_DETAIL:
    return state;
  case types.NEXT_DETAIL:
    return state;
  case types.ROTATE_DETAIL:
    return state;
  case types.COMPLETE_ROW:
    return state;
  case types.OVER_GAME:
    return state;
  case types.START_GAME:
    return state;
  default:
    return state;
  }
};

export default world;

@@ -97,16 +97,909 @@
 orld';%0A%0A
+const getStateWithNextDetail = (state, action) =%3E %7B%0A  const rangeFilter = (start, size) =%3E (x, dx) =%3E%0A    start %3E x %7C%7C x %3E start + size %7C%7C dx %3E= size;%0A%0A  console.log(action.detail);%0A  const getRangeFilter = (detail) =%3E %7B%0A    if (detail.get(0).size %3C 2) return rangeFilter(4, 2); // 2 x 2%0A    if (detail.get(0).size %3C 3) return rangeFilter(3, 3); // 3 x 3%0A    return rangeFilter(3, 4); // 4 x 4%0A  %7D;%0A%0A  const rangeFilterDetail = getRangeFilter(action.detail);%0A  const shadow = state.filter((row, y) =%3E y %3C 0);%0A%0A  const shadowWithDetail = shadow.map((row, y) =%3E %7B%0A    let dx = 0; // detail x%0A    if (y %3E action.detail.size) return row;%0A%0A    return row.get('blocks').map((block, x) =%3E %7B%0A      if (rangeFilterDetail(x, dx)) return block;%0A      return %7B%0A        id: block.get('id'),%0A        value: action.detail.get(y).get(dx++)%0A      %7D;%0A    %7D);%0A  %7D);%0A%0A  return state.merge(shadowWithDetail);%0A%7D;%0A%0A%0A
 const wo
@@ -1048,16 +1048,16 @@
 n) =%3E %7B%0A
-
   switch
@@ -1237,37 +1237,69 @@
 AIL:%0A    return 
-state
+getStateWithNextDetail(state, action)
 ;%0A  case types.R

add to add raw handle actions NEXT_DETAIL