mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-10 02:31:48 +00:00
format document
This commit is contained in:
parent
ca49753375
commit
b68713a143
@ -88,7 +88,7 @@ end
|
|||||||
--add a state
|
--add a state
|
||||||
function state_machine:add_state(name, state)
|
function state_machine:add_state(name, state)
|
||||||
if self:has_state(name) then
|
if self:has_state(name) then
|
||||||
error("error: added duplicate state "..name)
|
error("error: added duplicate state " .. name)
|
||||||
else
|
else
|
||||||
self.states[name] = state
|
self.states[name] = state
|
||||||
if self:in_state(name) then
|
if self:in_state(name) then
|
||||||
@ -102,7 +102,7 @@ end
|
|||||||
--remove a state
|
--remove a state
|
||||||
function state_machine:remove_state(name)
|
function state_machine:remove_state(name)
|
||||||
if not self:has_state(name) then
|
if not self:has_state(name) then
|
||||||
error("error: removed missing state "..name)
|
error("error: removed missing state " .. name)
|
||||||
else
|
else
|
||||||
if self:in_state(name) then
|
if self:in_state(name) then
|
||||||
self:_call("exit")
|
self:_call("exit")
|
||||||
|
Loading…
Reference in New Issue
Block a user