当前位置: 首页>>代码示例>>C++>>正文


C++ PlatformExtension::AddAutomatism方法代码示例

本文整理汇总了C++中gd::PlatformExtension::AddAutomatism方法的典型用法代码示例。如果您正苦于以下问题:C++ PlatformExtension::AddAutomatism方法的具体用法?C++ PlatformExtension::AddAutomatism怎么用?C++ PlatformExtension::AddAutomatism使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gd::PlatformExtension的用法示例。


在下文中一共展示了PlatformExtension::AddAutomatism方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DeclareDestroyOutsideAutomatismExtension

void DeclareDestroyOutsideAutomatismExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("DestroyOutsideAutomatism",
                              _("Destroy Outside Screen Automatism"),
                              _("Automatism destroying object when they go outside the screen"),
                              "Florian Rival",
                              "Open source (MIT License)");

    gd::AutomatismMetadata & aut = extension.AddAutomatism("DestroyOutside",
          _("Destroy when outside the screen"),
          _("DestroyOutside"),
          _("Automatically destroy the object when it goes outside the screen"),
          "",
          "CppPlatform/Extensions/destroyoutsideicon.png",
          "DestroyOutsideAutomatism",
          std::shared_ptr<gd::Automatism>(new DestroyOutsideAutomatism),
          std::shared_ptr<gd::AutomatismsSharedData>());

    #if defined(GD_IDE_ONLY)
    aut.SetIncludeFile("DestroyOutsideAutomatism/DestroyOutsideAutomatism.h");

    aut.AddCondition("ExtraBorder",
                   _("Additional border"),
                   _("Compare the additional border that the object must cross before being deleted."),
                   _("The additional border of _PARAM0_ is _PARAM2__PARAM3_"),
                   "",
                   "CppPlatform/Extensions/destroyoutsideicon24.png",
                   "CppPlatform/Extensions/destroyoutsideicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("automatism", _("Automatism"), "DestroyOutside", false)
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .MarkAsAdvanced()
        .SetFunctionName("GetExtraBorder").SetIncludeFile("DestroyOutsideAutomatism/DestroyOutsideAutomatism.h");

    aut.AddAction("ExtraBorder",
                   _("Additional border"),
                   _("Change the additional border that the object must cross before being deleted."),
                   _("Do _PARAM2__PARAM3_ to the additional border of _PARAM0_"),
                   "",
                   "CppPlatform/Extensions/destroyoutsideicon24.png",
                   "CppPlatform/Extensions/destroyoutsideicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("automatism", _("Automatism"), "DestroyOutside", false)
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .MarkAsAdvanced()
        .SetFunctionName("SetExtraBorder").SetManipulatedType("number")
        .SetGetter("GetExtraBorder").SetIncludeFile("DestroyOutsideAutomatism/DestroyOutsideAutomatism.h");
    #endif

}
开发者ID:AntonioModer,项目名称:GD,代码行数:52,代码来源:Extension.cpp

示例2: DeclarePlatformAutomatismExtension

void DeclarePlatformAutomatismExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("PlatformAutomatism",
                          _("Platform Automatism"),
                          _("Allows to use controllable objects which can run and jump on platforms."),
                          "Florian Rival",
                          "Open source (MIT License)");

    {
        gd::AutomatismMetadata & aut = extension.AddAutomatism("PlatformerObjectAutomatism",
              _("Platformer character"),
              "PlatformerObject",
              _("Controllable character which can jump and run on platforms."),
              "",
              "CppPlatform/Extensions/platformerobjecticon.png",
              "PlatformerObjectAutomatism",
              std::shared_ptr<gd::Automatism>(new PlatformerObjectAutomatism),
              std::shared_ptr<gd::AutomatismsSharedData>(new gd::AutomatismsSharedData));

        #if defined(GD_IDE_ONLY)
        aut.SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("IsMoving",
                       _("Is moving"),
                       _("Check if the object is moving (whether it is on the floor or in the air)."),
                       _("_PARAM0_ is moving"),
                       "",
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .MarkAsSimple()
            .SetFunctionName("IsMoving").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("IsOnFloor",
                       _("Is on floor"),
                       _("Check if the object is on a platform."),
                       _("_PARAM0_ is on floor"),
                       "",
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .MarkAsSimple()
            .SetFunctionName("IsOnFloor").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("IsOnLadder",
                       _("Is on ladder"),
                       _("Check if the object is on a ladder."),
                       _("_PARAM0_ is on ladder"),
                       "",
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .MarkAsAdvanced()
            .SetFunctionName("IsOnLadder").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("IsJumping",
                       _("Is jumping"),
                       _("Check if the object is jumping."),
                       _("_PARAM0_ is jumping"),
                       "",
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .MarkAsSimple()
            .SetFunctionName("IsJumping").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("IsFalling",
                       _("Is falling"),
                       _("Check if the object is falling.\nNote that the object can be flagged as jumping and falling at the same time: At the end of a jump, the fall speed becomes higher that the jump speed."),
                       _("_PARAM0_ is falling"),
                       "",
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .SetFunctionName("IsFalling").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("Gravity",
                       _("Gravity"),
                       _("Compare the gravity applied on the object (in pixels per second per second)."),
                       _("Gravity of _PARAM0_ is _PARAM2__PARAM3_"),
                       _("Options"),
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .AddParameter("relationalOperator", _("Comparison sign"))
            .AddParameter("expression", _("Value to test"))
            .MarkAsAdvanced()
            .SetFunctionName("GetGravity").SetManipulatedType("number").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddAction("Gravity",
                       _("Gravity"),
                       _("Change the gravity applied on an object (in pixels per second per second)."),
                       _("Do _PARAM2__PARAM3_ to the gravity applied on _PARAM0_"),
                       _("Options"),
//.........这里部分代码省略.........
开发者ID:AntonioModer,项目名称:GD,代码行数:101,代码来源:Extension.cpp


注:本文中的gd::PlatformExtension::AddAutomatism方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。