Sign in to follow this  

Logic System

This topic is 4340 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
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

This topic is 4340 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this