Re: (no subject)

Don Williamson <[email protected]> Wed, 16 Jun 2010 13:19:07 -0700 (PDT)
Newsgroups gmane.games.devel.sweng
Message-ID <[email protected]>
> With more modern annotations and mark-up, that might look something like:
> 
>   struct MyReflectedStruct {
>     struct_member,
>     networked(lambda { return some_network_queue; }),
>     editable("Count of Some things")
>       int someCount;
>   }
> 
> Look, ma, no repetition!

With __annotation, PDB lookup and using Spart C# to do some parsing if the innards, I've managed to get that to look something like this in C++


struct Configuration
{
    push_attr(group = "Base Group")

        std::string window_name;

        attr(transient, name = "Resolution", desc = "Specifies the resolution of the thingy", value = 3)
        Vec2Di resolution;

        Vec2Di offset;

        attr(min = 0.2, max = 0.4)
        float tolerance;

        std::vector<int> high_scores;
        std::vector<int> low_scores;
        std::vector< std::string > names;

    pop_attr();

    int fixed_array[5];
    std::string looking_place[2];
};


The concept of push/pop is pretty neat and just fell out of the implementation. It's all very hacky but so tantalisingly close to something good :)

Not as static as the undocumented attributes in VC, which is nice, but that does mean they're very high-level atributes, which is all I've ever needed for game code... so far!

I've hastily pushed everything up here: http://donw.org/rfl/

Cheers,
- Don



      
_______________________________________________
Sweng-Gamedev mailing list
[email protected]
http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com