Jump to content

VisibleClasses


Recommended Posts

Changeset 15196 broke a lot of Hannibal, since it uses classes as civ independent feature detector. Now farmsteads are still in class farmstead, but houses are no longer in class house. On the other hand cleaning up 3 different versions of civcentre is probably a good idea.

Google couldn't find a single bit of info about VisibleClasses, may I ask what is the thinking? Is there a plan and what is the difference between Classes and VisibleClasses. Why are both needed?

  • Like 1
Link to comment
Share on other sites

The plan is to remove that info from the tooltips of the gui. Now every unit has a class list which sometimes matches, sometimes not, and is a pain to localised.

I first tried with the buildings, to see if it works. But the units should follow.

There's a helper function to extract a single class list from the template in the simulation helpers. But that probably needs to be moved to the global scripts.

Link to comment
Share on other sites

Ok, I understand, the helper function provides the classes combined with no duplicates. That's good! The other part of the question targeted which classes contain which entities? It seems some classes are a must have, others are nice to have and others are superfluous.

Which entitiy <-> class relation is future proof?

Link to comment
Share on other sites

The classes have no hierarchy, an entity has multiple classes, and a class appears on multiple entities. They're merely tags.

Those tags can be used in the code to restrict stuff (I.e. restrict females to attack soldiers), to apply bonuses (I.e. the attack bonuses) or any other use of filtering.

So it's nice, when f.e. a technology states it affects military buildings, that you can see in the gui that a building is military. Otoh, some classes are really to broad (like you know what a unit is), and shouldn't be displayed.

That's why there is a distinction between visible classes, and classes that are only to aid programmatic filtering, but are really clear to the user without putting it in the gui.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...