Skip to content

Commit

Permalink
Add addTimedEvent method
Browse files Browse the repository at this point in the history
  • Loading branch information
enginmanap committed Jan 11, 2019
1 parent 591ce50 commit 8136132
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion docs/APIUsage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ ___________
+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|LimonAPI::ParameterRequest& |:ref:`getVariable(const std::string& variableName)<LimonAPI-getVariable>` |
+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|std::vector<ParameterRequest> |:ref:`rayCastToCursor()<LimonAPI-rayCastToCursor>` |
|std::vector<ParameterRequest> |:ref:`rayCastToCursor()<LimonAPI-rayCastToCursor>` |
+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|void |:ref:`addTimedEvent(long waitTime, std::function<void(const std::vector<LimonAPI::ParameterRequest>&)> methodToCall, std::vector<LimonAPI::ParameterRequest> parameters)<LimonAPI-addTimedEvent>` |
+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

.. _LimonAPI-animateModel:
Expand Down Expand Up @@ -738,6 +740,7 @@ std::vector<ParameterRequest> rayCastToCursor()

Returns information about what is under player cursor (crosshair). If nothing is found, empty vector is returned.
if something is hit, return vector will have the following information:

#. ObjectID of the hit object
#. hit coordinates
#. hit normal
Expand All @@ -747,6 +750,27 @@ Parameters:

none

.. _LimonAPI-addTimedEvent:

void addTimedEvent(long waitTime, std::function<void(const std::vector<LimonAPI::ParameterRequest>&)> methodToCall, std::vector<LimonAPI::ParameterRequest> parameters)
=======================================================================================================================================================================

Runs the given method, with passed parameters, after a given amount of time.

#. long waitTime: How long to wait before call, in milliseconds.
#. std::function<void(const std::vector<LimonAPI::ParameterRequest>&)> methodToCall: function to call.
#. std::vector<LimonAPI::ParameterRequest> parameters: parameters of that function call.

.. note::
Wait time is not precise beyond game ticks. Limon Engine internally ticks each 1/60 seconds.

.. warning::
If function is part of an object, and that object is removed, engine might crash. Avoiding those situations are game developers responsibility.

Parameters:

none

.. _LimonAPI-HowToImplementAnAction:

How to Implement an action
Expand Down

0 comments on commit 8136132

Please sign in to comment.