mirror of
https://github.com/rayaman/multi.git
synced 2026-09-05 07:27:35 -04:00
Updated Objects (markdown)
+26
-5
@@ -65,17 +65,38 @@ All actors have a few methods in common. These methods are
|
||||
* Pause() - Pauses the object
|
||||
* Resume() - Resumes the object
|
||||
* Destroy() - destroys the object
|
||||
* Hold(n)* - holds an object where it is while it waits for something to happen. where 'n' is an event or time
|
||||
* Hold(**number** n)* - holds an object where it is while it waits for something to happen. where 'n' is an event or time
|
||||
* IsHeld() - returns true or false whether the object is in a hold or not
|
||||
* WaitFor(obj)* - holds the object until
|
||||
* OnMainConnect(func) - connects to the main event of an actor object. These will be noted on each object below
|
||||
* Reallocate(runner_other, index) -- More on this on the
|
||||
*
|
||||
* OnMainConnect(**function**) - connects to the main event of an actor object. This will be noted on each object below
|
||||
* Reallocate(runner_other, index) -- More on this on the features page
|
||||
* FreeMainEvent() - frees all connections to the main event
|
||||
* ConnectFinal(**function**) - connects to the final event of an object. This will be noted on each object below
|
||||
* GetParentProcess() - returns the runner that is running the current object
|
||||
* Break() - breaks an object pausing it and triggering the OnBreak() Connection
|
||||
* OnBreak(**function**(self)) - a connection to the Break event on each actor
|
||||
* IsPaused() - returns true if an object is paused
|
||||
* IsActive() - returns true if an object is active
|
||||
* GetType() - returns the type of object that it is. The expected returns will be noted below with each object
|
||||
* Sleep(n)* - makes an object sleep for a while
|
||||
* SetTime(**number** n) - sets the time until an object should timeout
|
||||
* OnTimedOut(func) - triggers if an object times out. Note: an object will not time out unless you call SetTime(n) on it!
|
||||
* ResetTime(**number** n) - resets a timed out object
|
||||
* ResolveTimer(...) - triggers the OnTimerResloved event and passes along the arguments you pass
|
||||
* OnTimerResolved(**function**(self,...)) - is triggered by the ResolveTimer() function
|
||||
* Reset() - resets an object, in most cases this acts like Resume()
|
||||
* IsDone() - returns true if an object is done doing something. In most cases it works like IsActive()
|
||||
* NewCondition - creates a condition object [features](https://github.com/rayaman/multi/wiki/features#Conditions)
|
||||
* NewRange() - creates a range object [features](https://github.com/rayaman/multi/wiki/features#Ranges)
|
||||
* Condition() - tests a condition [features](https://github.com/rayaman/multi/wiki/features#Conditions)
|
||||
|
||||
*Note: that only one object can be held at a time, and only on the main runner! If you need more flexibility use [threads](https://github.com/rayaman/multi/wiki/threading). The threading page will explain how this works. Its just like regular objects so you will understand that easily after grasping how each actor itself works.
|
||||
# events
|
||||
The event object has this structure
|
||||
|
||||
event:
|
||||
**function** OnEvent(func)
|
||||
* **function** OnEvent(func)
|
||||
* **string** Type
|
||||
|
||||
# Semi-Actors
|
||||
|
||||
|
||||
Reference in New Issue
Block a user