Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Safe LuaObject:ApplyAt API #5222

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/lua/LuaObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,31 @@
* Status:
*
* stable
*
*
* Method: ApplyAt
*
* Apply a function to the object at a given in-game time.
*
* > object:ApplyAt(gametime, function)
*
* Time acceleration may cause the function to be applied long after the
* desired time has passed. This method isn't called if the object
* doesn't exist anymore.
*
* Parameters:
*
* time - the absolute game time to apply the function at. This will usually
* be created by adding some small amount to <Game.time>.
* function - the function to apply. Takes one parameter (the object) and returns nothing
*
* Example:
*
* > ship:ApplyAt(Game.time + 5, function(s) s:Explode())
*
* Status:
*
* stable
*/

static std::map<std::string, std::map<std::string, PromotionTest>> promotions;
Expand Down