local P=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local Y=require(P.Game.Rodux)local z=require(P.Packages.sift)local V=require(P.Game.Shared.DataTemplate)local I=z.Dictionary.copy(V.GridObjects)local s=Y.createReducer(I,{SetObjects=function(P,Y)return z.Array.copyDeep(Y.objects)end;AddObject=function(P,Y)return z.Array.push(P,Y.serialized)end,RemoveObject=function(P,Y)return z.Array.removeValue(P,Y.serialized)end})return s
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Rodux = require(ReplicatedStorage.Game.Rodux)
local Sift = require(ReplicatedStorage.Packages.sift)
local DataTemplate = require(ReplicatedStorage.Game.Shared.DataTemplate)

local initialState = Sift.Dictionary.copy(DataTemplate.GridObjects)

local reducer = Rodux.createReducer(initialState, {
	SetObjects = function(_state, action)
		return Sift.Array.copyDeep(action.objects)
	end,

	AddObject = function(state, action)
		return Sift.Array.push(state, action.serialized)
	end,

	RemoveObject = function(state, action)
		return Sift.Array.removeValue(state, action.serialized)
	end,
})

return reducer
