Class l2df.manager.kinds
Kinds manager.
Info:
- Copyright: Atom-TM 2020
- Author: Abelidze
Functions
Manager:init([kwargs]) | Configure KindsManager. |
Manager:add(filepath) | Loads and adds the kind file to the local collection. |
Manager:load(directory) | Loads kind files from the specified directory. |
Manager:run(kind, ...) | Runs specified kind with arguments. |
Manager:get(kind) | Gets a kind from the list by its key. |
Fields
Kind | Kind is a function for handling collision events. |
Functions
Methods- Manager:init([kwargs])
-
Configure KindsManager.
Currently does nothing.
Parameters:
- kwargs table Keyword arguments. Not actually used yet. (optional)
Returns:
- Manager:add(filepath)
-
Loads and adds the kind file to the local collection.
Parameters:
-
filepath
string
Path to the
".lua"
file containing kind-function. Name of the file will be used as kind's ID.
-
filepath
string
Path to the
- Manager:load(directory)
-
Loads kind files from the specified directory.
Parameters:
-
directory
string
Directory to scan for
".lua"
files containing kind-function. For each loaded script name of the file will be used as kind's ID.
-
directory
string
Directory to scan for
- Manager:run(kind, ...)
-
Runs specified kind with arguments.
Parameters:
- kind number or string ID / name of the kind
- ... Arguments to be passed to kind-function.
Returns:
-
mixed or nil
Result of the kind-function execution.
- Manager:get(kind)
-
Gets a kind from the list by its key.
Parameters:
- kind number or string ID / name of the kind
Returns:
-
l2df.manager.kinds.Kind or nil
Fields
- Kind function
-
Kind is a function for handling collision events.
It assepts these arguments:
*e1
(l2df.class.entity) - the first entity for the triggered collision;
*e2
(l2df.class.entity) - the second entity for the triggered collision;
*c1
(l2df.manager.physix.Collider) - collider of the first entity;
*c2
(l2df.manager.physix.Collider) - collider of the second entity.