Jump to content
  • Advertisement

TechRogue

Member
  • Content Count

    68
  • Joined

  • Last visited

Community Reputation

722 Good

About TechRogue

  • Rank
    Member
  1. TechRogue

    How is cast<T>() registered?

    I assumed that would be the case. The implicit cast trick is a good one (and I actually realized I could do it while writing this post), the only drawback is that you have to assign it before you can use the properties or methods of the Type class...though I suppose I could register the same members to both types.   That post looks great! I'll definitely check his code out. Thanks for the reply.
  2. TechRogue

    How is cast<T>() registered?

    Just what it says in the title. I know you can't register template methods on objects, but it's recently occurred to me that cast appears to use a templated function. Is that something that's built into the language, or can it be repeated in user code?   I'm working on a few classes that expose reflection to the scripting language, and currently I've got it set up like this:   I have a Type class, which has no default factory. It requires a parameter of type __typeof. I have a Typeof class, which is registered with the engine as both __typeof and typeof<T>. typeof<T> is implicitly convertable to __typeof. __typeof has no factory defined at all, so it can only be created from an instance of typeof<T>. It's a convoluted setup, but ultimately it allows me to do this: Type myType(typeof<MyClass>()) What I'm wondering now is whether I can make a function that behaves in the same way as cast<T>(), with the end result being a syntax that looks like this: Type myType = typeof<MyClass>(); Of course, the best possible result would be to mimic C# syntax exactly, but I don't think that's possible; Type myType = typeof(MyClass);
  3. TechRogue

    Array trailing comma

    Totally understandable -- my comment was based on the assumption that Angelscript was like every other language I've used and that a trailing comma didn't make any difference at all.
  4. TechRogue

    Array trailing comma

    Oh, I wasn't aware of this. Very strange. I've never used another language with that behavior...sounds like it probably does more harm than good, no? You can always pass null or 0 if you want to have uninitialized elements in your array.
  5. TechRogue

    Array trailing comma

    Why would you want that though? It has no adverse effect and just makes it easier to add new elements if you're still working on the code.
  6. TechRogue

    AngelScript 2.29.1

    I much prefer the new syntax for named arguments. No ambiguity to worry about, and C# programmers will be right at home.
  7. TechRogue

    AngelScript 2.28.2 is out

    Ah, very nice!
  8. TechRogue

    AngelScript 2.28.2 is out

    Anonymous objects? Is that anything like in C#?   var obj = {     str = "a string",    num = 100 };
  9. TechRogue

    the compiler doesn't compile the script

    I feel like running a random exe that requires UAC to be disabled is a terribly unsafe thing to do.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!