Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7403259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:01:06+00:00 2026-05-29T05:01:06+00:00

I have a game object which processed in two completely different places. In Contact

  • 0

I have a game object which processed in two completely different places. In Contact Listener i check some conditions and if they occur i must save one or more portions of complex data. So i decided to use struct. For example:

struct SomeStruct
{
    int value1;
    int value2;
    CGPoint value3;
    b2Vec2 value4;
};

typedef SomeStruct SomeStruct;

In Game Scene i go through all game objects and if its the stack/array not empty, do some stuff and wipe it.

In Contact Listener it repeats from the beginning.

I must use this architecture because of strict order of execution (method must be called after other methods).

I suspect that i need something like vector or NSMutableArray (i think it will not work with struct), so vector may the the only way.

But don’t understand how to achieve it. May you help me with some code/pseudocode or link to the book/article where i can found a solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:01:09+00:00Added an answer on May 29, 2026 at 5:01 am

    There is a lot of solutions for this problem.

    1. Don’t use struct. An obj-c class is practically the same thing as a struct.
    2. Use CFArray (CFArrayCreateMutable) and put it there as a pointer.
    3. Use a C++ class with STL vector.
    4. Use a C array (SomeStruct[]) and increase its length when you need it.
    5. Use a classic implementation of a stack, with a linked list (every struct has a pointer to the next value).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an object named game which has a property called channels (which is
i have an object which is needed through out the game in every 10
I have an object: POP_CULTURE_TYPES = ( ('SG','Song'), ('MV', 'Movie'), ('GM', 'Game'), ('TV', 'TV'),
I have a game in which you can score from -40 to +40 on
I have a text log from a game with (for example) two types of
I have the following plugin, which takes a partial game name, bounces it off
In C++, I have an Object class, from which a number of other classes
I am making a video game and I have a main thread which takes
Dear all, this is going to be tough: I have created a game object
I have a game engine design written in C++ where a platform-independent game object

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.