Esempio n. 1
0
    /**
     * \brief Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
     */
    DraggableAutomatismJsExtension()
    {
        SetExtensionInformation("DraggableAutomatism",
                                _("Draggable Automatism"),
                                _("Automatism allowing to move objects with the mouse"),
                                "Florian Rival",
                                "Open source (MIT License)");

        DeclareDraggableAutomatismExtension(*this);

        GetAutomatismMetadata("DraggableAutomatism::Draggable").SetIncludeFile("DraggableAutomatism/draggableruntimeautomatism.js");
        GetAllConditionsForAutomatism("DraggableAutomatism::Draggable")["DraggableAutomatism::Dragged"].SetFunctionName("isDragged").SetIncludeFile("DraggableAutomatism/draggableruntimeautomatism.js");
        GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
    };
Esempio n. 2
0
    /**
     * \brief Constructor of an extension declares everything the extension contains : Objects, actions, conditions and expressions.
     */
    TopDownMovementAutomatismJsExtension()
    {
        DeclareTopDownMovementAutomatismExtension(*this);

        GetAutomatismMetadata("TopDownMovementAutomatism::TopDownMovementAutomatism")
            .SetIncludeFile("TopDownMovementAutomatism/topdownmovementruntimeautomatism.js");

        std::map<std::string, gd::InstructionMetadata > & autActions = GetAllActionsForAutomatism("TopDownMovementAutomatism::TopDownMovementAutomatism");
        std::map<std::string, gd::InstructionMetadata > & autConditions = GetAllConditionsForAutomatism("TopDownMovementAutomatism::TopDownMovementAutomatism");
        std::map<std::string, gd::ExpressionMetadata > & autExpressions = GetAllExpressionsForAutomatism("TopDownMovementAutomatism::TopDownMovementAutomatism");

        autConditions["TopDownMovementAutomatism::IsMoving"].codeExtraInformation.SetFunctionName("isMoving");

        autActions["TopDownMovementAutomatism::Acceleration"].codeExtraInformation.SetFunctionName("setAcceleration").SetAssociatedGetter("getAcceleration");
        autConditions["TopDownMovementAutomatism::Acceleration"].codeExtraInformation.SetFunctionName("getAcceleration");
        autActions["TopDownMovementAutomatism::Deceleration"].codeExtraInformation.SetFunctionName("setDeceleration").SetAssociatedGetter("getDeceleration");
        autConditions["TopDownMovementAutomatism::Deceleration"].codeExtraInformation.SetFunctionName("getDeceleration");
        autActions["TopDownMovementAutomatism::MaxSpeed"].codeExtraInformation.SetFunctionName("setMaxSpeed").SetAssociatedGetter("getMaxSpeed");
        autConditions["TopDownMovementAutomatism::MaxSpeed"].codeExtraInformation.SetFunctionName("getMaxSpeed");
        autConditions["TopDownMovementAutomatism::Speed"].codeExtraInformation.SetFunctionName("getSpeed");
        autActions["TopDownMovementAutomatism::AngularMaxSpeed"].codeExtraInformation.SetFunctionName("setAngularMaxSpeed").SetAssociatedGetter("getAngularMaxSpeed");
        autConditions["TopDownMovementAutomatism::AngularMaxSpeed"].codeExtraInformation.SetFunctionName("getAngularMaxSpeed");
        autActions["TopDownMovementAutomatism::AngleOffset"].codeExtraInformation.SetFunctionName("setAngleOffset").SetAssociatedGetter("getAngleOffset");
        autConditions["TopDownMovementAutomatism::AngleOffset"].codeExtraInformation.SetFunctionName("getAngleOffset");

        autActions["TopDownMovementAutomatism::AllowDiagonals"].codeExtraInformation.SetFunctionName("allowDiagonals");
        autConditions["TopDownMovementAutomatism::DiagonalsAllowed"].codeExtraInformation.SetFunctionName("diagonalsAllowed");
        autActions["TopDownMovementAutomatism::RotateObject"].codeExtraInformation.SetFunctionName("setRotateObject");
        autConditions["TopDownMovementAutomatism::ObjectRotated"].codeExtraInformation.SetFunctionName("isObjectRotated");

        autActions["TopDownMovementAutomatism::SimulateLeftKey"].codeExtraInformation.SetFunctionName("simulateLeftKey");
        autActions["TopDownMovementAutomatism::SimulateRightKey"].codeExtraInformation.SetFunctionName("simulateRightKey");
        autActions["TopDownMovementAutomatism::SimulateUpKey"].codeExtraInformation.SetFunctionName("simulateUpKey");
        autActions["TopDownMovementAutomatism::SimulateDownKey"].codeExtraInformation.SetFunctionName("simulateDownKey");
        autActions["TopDownMovementAutomatism::SimulateControl"].codeExtraInformation.SetFunctionName("simulateControl");
        autActions["TopDownMovementAutomatism::IgnoreDefaultControls"].codeExtraInformation.SetFunctionName("ignoreDefaultControls");

        autExpressions["Acceleration"].codeExtraInformation.SetFunctionName("getAcceleration");
        autExpressions["Deceleration"].codeExtraInformation.SetFunctionName("getDeceleration");
        autExpressions["MaxSpeed"].codeExtraInformation.SetFunctionName("getMaxSpeed");
        autExpressions["Speed"].codeExtraInformation.SetFunctionName("getSpeed");
        autExpressions["AngularMaxSpeed"].codeExtraInformation.SetFunctionName("getAngularMaxSpeed");
        autExpressions["AngleOffset"].codeExtraInformation.SetFunctionName("getAngleOffset");

        GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
    };
Esempio n. 3
0
    /**
     * \brief Constructor of an extension declares everything the extension contains : Objects, actions, conditions and expressions.
     */
    DestroyOutsideAutomatismJsExtension()
    {
        SetExtensionInformation("DestroyOutsideAutomatism",
                              _("Destroy Outside Screen Automatism"),
                              _("Automatism destroying object when they go outside the screen"),
                              "Florian Rival",
                              "zlib/libpng License (Open Source)");
        DeclareDestroyOutsideAutomatismExtension(*this);

        GetAutomatismMetadata("DestroyOutsideAutomatism::DestroyOutside").SetIncludeFile("DestroyOutsideAutomatism/destroyoutsideruntimeautomatism.js");

        GetAllConditionsForAutomatism("DestroyOutsideAutomatism::DestroyOutside")["DestroyOutsideAutomatism::ExtraBorder"].codeExtraInformation
            .SetFunctionName("getExtraBorder").SetIncludeFile("DestroyOutsideAutomatism/destroyoutsideruntimeautomatism.js");
        GetAllActionsForAutomatism("DestroyOutsideAutomatism::DestroyOutside")["DestroyOutsideAutomatism::ExtraBorder"].codeExtraInformation
            .SetFunctionName("setExtraBorder").SetAssociatedGetter("getExtraBorder").SetIncludeFile("DestroyOutsideAutomatism/destroyoutsideruntimeautomatism.js");

        GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
    };
Esempio n. 4
0
    /**
     * \brief Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
     */
    PlatformAutomatismJsExtension()
    {
        SetExtensionInformation("PlatformAutomatism",
                              _("Platform Automatism"),
                              _("Allows to use controllable objects which can run and jump on platforms."),
                              "Florian Rival",
                              "Open source (MIT License)");
        DeclarePlatformAutomatismExtension(*this);

        GetAutomatismMetadata("PlatformAutomatism::PlatformAutomatism")
            .SetIncludeFile("PlatformAutomatism/platformruntimeautomatism.js")
            .AddIncludeFile("PlatformAutomatism/platformerobjectruntimeautomatism.js");

        GetAutomatismMetadata("PlatformAutomatism::PlatformerObjectAutomatism")
            .SetIncludeFile("PlatformAutomatism/platformruntimeautomatism.js")
            .AddIncludeFile("PlatformAutomatism/platformerobjectruntimeautomatism.js");

        {

            std::map<std::string, gd::InstructionMetadata > & autActions = GetAllActionsForAutomatism("PlatformAutomatism::PlatformerObjectAutomatism");
            std::map<std::string, gd::InstructionMetadata > & autConditions = GetAllConditionsForAutomatism("PlatformAutomatism::PlatformerObjectAutomatism");
            std::map<std::string, gd::ExpressionMetadata > & autExpressions = GetAllExpressionsForAutomatism("PlatformAutomatism::PlatformerObjectAutomatism");

            autConditions["PlatformAutomatism::IsMoving"].SetFunctionName("isMoving");
            autConditions["PlatformAutomatism::IsOnFloor"].SetFunctionName("isOnFloor");
            autConditions["PlatformAutomatism::IsOnLadder"].SetFunctionName("isOnLadder");
            autConditions["PlatformAutomatism::IsJumping"].SetFunctionName("isJumping");
            autConditions["PlatformAutomatism::IsFalling"].SetFunctionName("isFalling");

            autConditions["PlatformAutomatism::Gravity"].SetFunctionName("getGravity");
            autActions["PlatformAutomatism::Gravity"].SetFunctionName("setGravity").SetGetter("getGravity");
            autExpressions["Gravity"].SetFunctionName("getGravity");
            autConditions["PlatformAutomatism::MaxFallingSpeed"].SetFunctionName("getMaxFallingSpeed");
            autActions["PlatformAutomatism::MaxFallingSpeed"].SetFunctionName("setMaxFallingSpeed").SetGetter("getMaxFallingSpeed");
            autExpressions["MaxFallingSpeed"].SetFunctionName("getMaxFallingSpeed");
            autConditions["PlatformAutomatism::Acceleration"].SetFunctionName("getAcceleration");
            autActions["PlatformAutomatism::Acceleration"].SetFunctionName("setAcceleration").SetGetter("getAcceleration");
            autExpressions["Acceleration"].SetFunctionName("getAcceleration");
            autConditions["PlatformAutomatism::Deceleration"].SetFunctionName("getDeceleration");
            autActions["PlatformAutomatism::Deceleration"].SetFunctionName("setDeceleration").SetGetter("getDeceleration");
            autExpressions["Deceleration"].SetFunctionName("getDeceleration");
            autConditions["PlatformAutomatism::MaxSpeed"].SetFunctionName("getMaxSpeed");
            autActions["PlatformAutomatism::MaxSpeed"].SetFunctionName("setMaxSpeed").SetGetter("getMaxSpeed");
            autExpressions["MaxSpeed"].SetFunctionName("getMaxSpeed");
            autConditions["PlatformAutomatism::JumpSpeed"].SetFunctionName("getJumpSpeed");
            autActions["PlatformAutomatism::JumpSpeed"].SetFunctionName("setJumpSpeed").SetGetter("getJumpSpeed");
            autExpressions["JumpSpeed"].SetFunctionName("getJumpSpeed");

            autActions["PlatformAutomatism::SetCanJump"].SetFunctionName("setCanJump");
            autActions["PlatformAutomatism::SimulateLeftKey"].SetFunctionName("simulateLeftKey");
            autActions["PlatformAutomatism::SimulateRightKey"].SetFunctionName("simulateRightKey");
            autActions["PlatformAutomatism::SimulateUpKey"].SetFunctionName("simulateUpKey");
            autActions["PlatformAutomatism::SimulateDownKey"].SetFunctionName("simulateDownKey");
            autActions["PlatformAutomatism::SimulateLadderKey"].SetFunctionName("simulateLadderKey");
            autActions["PlatformAutomatism::SimulateJumpKey"].SetFunctionName("simulateJumpKey");
            autActions["PlatformAutomatism::SimulateControl"].SetFunctionName("simulateControl");
            autActions["PlatformAutomatism::IgnoreDefaultControls"].SetFunctionName("ignoreDefaultControls");
        }
        {
            std::map<std::string, gd::InstructionMetadata > & autActions = GetAllActionsForAutomatism("PlatformAutomatism::PlatformAutomatism");

            autActions["PlatformAutomatism::ChangePlatformType"].SetFunctionName("changePlatformType");
        }
        GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
    };