Archived

This topic is now archived and is closed to further replies.

Toni Petrina

Level editor problem

Recommended Posts

My problem is that I don''t know how to (easily) expose properties of C++ class to editor so that I can change attribute of particular object. My current solution is to complex (write layout for each class). Any ideas, suggestions.

Share this post


Link to post
Share on other sites
Your question is pretty vague, but if I get it right, typically if you are going with a encapsulation approach and have all property of an object as private, you will want a Get and Set method for each property that needs access.

Share this post


Link to post
Share on other sites
I don''t have much classes yet(7 so far). My current implementation is similar to that in HL1 SDK : static member(array) that carries description about all class attributes. Those arrays can be concatenated together(for inheritance).

Share this post


Link to post
Share on other sites
You could use a std::map<std::string, BaseDator> for each class, using the Dator code from Enginuity. If you put the map in a base class, and then had each derived class add its own properties to the map in the constructor, you'd build up the properties througout the hierarchy.

[edit: fixed html entities]

Superpig
- saving pigs from untimely fates, and when he's not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4
ry. .ibu cy. .abu ry. dy. "sy. .ubu py. .ebu ry. py. .ibu gy." fy. .ibu ny. .ebu

[edited by - Superpig on October 10, 2003 4:36:06 PM]

Share this post


Link to post
Share on other sites