News Forums RAIN General Discussion and Troubleshooting RAINAction Constructor Required?

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Sigil 5 months, 2 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #40106

    RAINLover
    Participant

    Question: Is the RAINAction Constructor Required? When I create a Custom Action, the RAIN template looks like this:

    [RAINAction]
    public class BlahBlah : RAINAction
    {
      public override void Start(AI ai)
      {
        base.Start(ai)
      }
      public override .... etc etc.....
    }

    However, many examples show a constructor:

    [RAINAction]
    public class BlahBlah : RAINAction
    {
      public BlahBlah() 
      {
        //WHY IS THIS REQUIRED?
        actionName = "BlahBlah;
      }
      public override void Start(AI ai)
      {
        base.Start(ai)
      }
      public override .... etc etc.....
    }

    Why do we need to define a constructor? What is the purpose of setting the inherited property actionName?

    Thanks!

    • This topic was modified 5 months, 2 weeks ago by  RAINLover.
    • This topic was modified 5 months, 2 weeks ago by  RAINLover.
    #40121

    Sigil
    Keymaster

    It is no longer required. I removed them from the templates awhile back ago but the examples will still have them in many cases. I believe I changed it to automatically set it for you, and it is kind of a holdover from earlier versions of RAIN anyhow, so it isn’t really useful.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.