You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.1 KiB
30 lines
1.1 KiB
-- ------------------------------------------------------------------------------ --
|
|
-- TradeSkillMaster --
|
|
-- https://tradeskillmaster.com --
|
|
-- All Rights Reserved - Detailed license information included with addon. --
|
|
-- ------------------------------------------------------------------------------ --
|
|
|
|
local TSM = select(2, ...) ---@type TSM
|
|
local FSM = TSM.Init("Util.FSM") ---@class Util.FSM
|
|
local Machine = TSM.Include("Util.FSMClasses.Machine")
|
|
local State = TSM.Include("Util.FSMClasses.State")
|
|
|
|
|
|
|
|
-- ============================================================================
|
|
-- Module Functions
|
|
-- ============================================================================
|
|
|
|
---Create a new FSM.
|
|
---@param name string The name of the FSM (for debugging purposes)
|
|
---@return FSMObject @The FSM object
|
|
function FSM.New(name)
|
|
return Machine.Create(name)
|
|
end
|
|
|
|
---Create a new FSM state.
|
|
---@param state string The name of the state
|
|
---@return FSMState @The State object
|
|
function FSM.NewState(state)
|
|
return State.Create(state)
|
|
end
|
|
|