Jump to content
  • Advertisement
Sign in to follow this  
Asheh

Logic System

This topic is 4558 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The game logic systems I have designed i the past never had a way of passing data via states, because they were separate classes. I was wondering if anyone has a solution to this? A few ive been thinking are... - Passing a piece of serialized data - Passing a void * and casting - Have a "CGameData" which contains the data to be passed For tidyness and expandability I would consider serialized data, but how is this achieved? And has anyone else got an alternative? Regards Ash. Eh

Share this post


Link to post
Share on other sites
Advertisement
Quote:

Passing a void * and casting


This is what I do and works well. I recommend it. However, passing data through classes can be achieved by either encapsulating all data under one main class, or making the data in the class "public" to all classes. The later can be a bit dangerous but you can also have an LogicClass.export() function that returns data in a void* that you can then copy into other methods or read by other classes.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!