local o=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local T=o:WaitForChild("\108\105\098")local m=require(T:WaitForChild("\116"))return{fromClient={ready={arguments=m.tuple(m.none)},requestCoinCollect={arguments=m.tuple(m.Instance)};requestCandyCollect={arguments=m.tuple(m.Instance)},portalActivate={arguments=m.tuple(m.string)};buyAsset={arguments=m.tuple(m.string)},buyDevproduct={arguments=m.tuple(m.string)};equipAsset={arguments=m.tuple(m.string)};unequipAsset={arguments=m.tuple(m.string)};equippedAction={arguments=m.tuple(m.string,m.payload)}},fromServer={initialPlayerState={arguments=m.tuple(m.any)};storeAction={arguments=m.tuple(m.table)},coinRespawn={arguments=m.tuple(m.Instance)},candyRespawn={arguments=m.tuple(m.Instance)},equippedBroadcast={arguments=m.tuple(m.Instance,m.string,m.payload)}}}
-- Author: Lucien Greathouse
-- https://github.com/LPGhatguy/rdc-project/blob/master/src/common/ApiSpec.lua

--[[
	This file specifies the protocol for communication between the client and
	server.
	It uses 'Typer' as a way to encode type signatures into the remotes, which
	are checked on both ends. This should be enough to verify that well-behaved
	clients are obeying the API contract, and acts as a first-pass guard against
	malicious clients.
	Both the client and server must implement the correct points of this API.
	Each remote is only one-way to prevent low-hanging fruit exploits related to
	causing a server to yield forever when using RemoteFunction objects.
	The server will automatically generate a RemoteEvent object for every object
	in this table.
	The client will automatically wait for every event to exist and connect to
	each of them.
]]
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local lib = ReplicatedStorage:WaitForChild("lib")

local t = require(lib:WaitForChild("t"))

return {
	fromClient = {
		ready = {
			arguments = t.tuple(
				t.none
			),
		},
		requestCoinCollect = {
            arguments = t.tuple(
                t.Instance -- spawn the coin you are collecting is tied to
            )
		},
		requestCandyCollect = {
            arguments = t.tuple(
                t.Instance -- spawn the candy you are collecting is tied to
            )
		},
		portalActivate = {
            arguments = t.tuple(
                t.string -- id of portal you are activating
            )
		},
		buyAsset = {
			arguments = t.tuple(
				t.string -- asset id that you are trying to buy.
			)
		},
		buyDevproduct = {
			arguments = t.tuple(
				t.string -- devproduct id that you are trying to buy.
			)
		},
		equipAsset = {
			arguments = t.tuple(
				t.string -- asset id that you are trying to equip
			)
		},
		unequipAsset = {
			arguments = t.tuple(
				t.string -- asset id that you are trying to unequip
			)
		},
		equippedAction = {
			arguments = t.tuple(
				t.string, -- assetid that is being used and should recieve the action (if its equipped)
				t.payload -- action payload (action type, any arguments (target, options))
			)
		}
	},
	fromServer = {
		initialPlayerState = {
			arguments = t.tuple(
				t.any -- initial state for player store
			)
		},
		storeAction = {
			arguments = t.tuple(
                t.table -- action to be dispatched to player
            )
        },
        coinRespawn = {
            arguments = t.tuple(
                t.Instance -- spawn that is respawning its coin
            )
		},
		candyRespawn = {
            arguments = t.tuple(
                t.Instance -- spawn that is respawning its candy
            )
		},
		equippedBroadcast = {
			arguments = t.tuple(
				t.Instance, -- player performing this action
				t.string, -- assetid that is being used and should recieve the action (if its equipped)
				t.payload -- action payload (action type, any arguments (target, options))
			)
		}
	},
}