Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 14, 2017, 4:04:14 PM (7 years ago)
Author:
kohlia
Message:

The ScriptableController should work now. A demo level called scriptableControllerTest exists as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller_api.h

    r11662 r11673  
    146146     * @param type Name of the class of the object you want to spawn
    147147     * @param id The newly created ID that can be used to access this object
     148     *
     149     * IMPORTANT: Do not use this function yet, it only has minimal functionality and is not
     150     * really helpful as it is.
    148151     */
    149152    void spawn(std::string type, std::string id);
     
    196199
    197200private:
    198     /**
    199      * @brief Called by ScriptableController when a pawn is killed
    200      * @param id The dead pawn
    201      *
    202      * Calls the lua callbacks associated with this event.
    203      */
    204     void pawnKilled(std::string id, Pawn *pawn);
    205 
    206     /**
    207      * @brief Called by ScriptableController when a Pawn is hit
    208      * @param target_id The hit Pawn
    209      * @param source_id The shooting Pawn
    210      * @param new_health The new health of the hit Pawn
    211      * @param new_shield The new shield health of the hit Pawn
    212      */
    213     void pawnHit(std::string target_id, std::string source_id, double new_health, double new_shield);
    214 
    215201    /**
    216202     * @brief Groups everything together that is needed to handle a near-object event
     
    260246    };
    261247
    262 
    263248    lua_State *lua_;
    264249    ScriptableController *controller_;
     
    266251    std::list<NearPointHandler> nearPointHandlers_;
    267252    std::list<AreaHandler> areaHandlers_;
    268     std::list<std::string> pawnsToKill_;
    269253    std::map<std::string, std::list<std::function<void (std::string)> > > pawnDestroyedHandlers_;
    270254    std::map<std::string, std::list<std::function<void (std::string, std::string, double, double)> > > pawnHitHandlers_;
     
    273257
    274258    /**
     259     * @brief Called by ScriptableController when a pawn is killed
     260     * @param id The dead pawn
     261     *
     262     * Calls the lua callbacks associated with this event.
     263     */
     264    void pawnKilled(std::string id, Pawn *pawn);
     265
     266    /**
     267     * @brief Called by ScriptableController when a Pawn is hit
     268     * @param target_id The hit Pawn
     269     * @param source_id The shooting Pawn
     270     * @param new_health The new health of the hit Pawn
     271     * @param new_shield The new shield health of the hit Pawn
     272     */
     273    void pawnHit(std::string target_id, std::string source_id, double new_health, double new_shield);
     274
     275    /**
    275276     * @brief Called every 0.5s
    276277     *
    277      * This handles things that have to be checked periodically (like area events) and
    278      * things that are done by lua that have to synchronize with the main thread (like
    279      * killing a pawn). Doing this in every tick would be an overkill.
     278     * This handles things that have to be checked periodically (like area events)
     279     * but doing this in every tick would be an overkill.
    280280     */
    281281    void periodic(void);
Note: See TracChangeset for help on using the changeset viewer.