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={itemId=nil;rotation=0,position=Vector2.new(0,0),canPlace=false,mode="\098\117\105\108\100"}local I=Y.createReducer(V,{SetBuild=function(P,Y)return z.Dictionary.merge(P,{itemId=Y.itemId})end;SetRotation=function(P,Y)return z.Dictionary.merge(P,{rotation=Y.rotation})end;SetPosition=function(P,Y)return z.Dictionary.merge(P,{position=Y.position})end;SetCanPlace=function(P,Y)return z.Dictionary.merge(P,{canPlace=Y.canPlace})end;SetMode=function(P,Y)return z.Dictionary.merge(P,{mode=Y.mode})end})return I
local ReplicatedStorage = game:GetService("ReplicatedStorage")

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

local initialState = {
	itemId = nil,

	rotation = 0,
	position = Vector2.new(0, 0),

	canPlace = false,

	mode = "build",
}

local reducer = Rodux.createReducer(initialState, {
	SetBuild = function(state, action)
		return Sift.Dictionary.merge(state, {
			itemId = action.itemId,
		})
	end,

	SetRotation = function(state, action)
		return Sift.Dictionary.merge(state, {
			rotation = action.rotation,
		})
	end,

	SetPosition = function(state, action)
		return Sift.Dictionary.merge(state, {
			position = action.position,
		})
	end,

	SetCanPlace = function(state, action)
		return Sift.Dictionary.merge(state, {
			canPlace = action.canPlace,
		})
	end,

	SetMode = function(state, action)
		return Sift.Dictionary.merge(state, {
			mode = action.mode,
		})
	end,
})

return reducer
