From 838edb29ff4330a82bafe2a6d753fa422db37d37 Mon Sep 17 00:00:00 2001 From: Ryan Ward Date: Wed, 14 Jun 2017 15:58:06 -0400 Subject: [PATCH] Updated Objects (markdown) --- Objects.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Objects.md b/Objects.md index 59b6b73..f59231c 100644 --- a/Objects.md +++ b/Objects.md @@ -25,6 +25,7 @@ multi:mainloop() -- start the main runner Note: I will not be giving the output to all examples on the wiki As mentioned above you can load a process from file. This can only work if your lua environment allows for the usage of loadstring! + **testfile.lua** ```lua process:newTLoop(function(self) @@ -60,6 +61,22 @@ Here is a list of every actor within the library * [updaters](https://github.com/rayaman/multi/wiki/Objects#updaters) - runner:newUpdater([**number** skip -- defualts to 0]) * [watchers](https://github.com/rayaman/multi/wiki/Objects#watchers) - runnet:newWatcher(**table** namespace, **string** name) +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 +* 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 +* +*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) + # Semi-Actors