Arrays, queues and stacks

More
18 years 8 months ago #18516 by Joco
Ok - from what I can see we don't have a native concept of arrays and therefore such things as queues or stacks for anything other than objects.

So, has anyone put together some library routines for faking these under pog? I have a way of doing this that has been used in other games that don't provide these forms as standard, but just hoped to save myself some coding if possible.

Cheers,
Joco.

Please Log in or Create an account to join the conversation.

More
18 years 8 months ago #13479 by GrandpaTrout
I don't. The problem with non-object stacks and queues is that you must do a string manipulation for each access. And that is painfully slow. So I find it is just better to use objects and object properties. And then if they need to be saved, serialize at save time.

I have built some string based arrays, but I regretted it at performance time. The economy has a few and it takes over 20 seconds to process a turn.

Please Log in or Create an account to join the conversation.

More
18 years 8 months ago #13480 by Joco
Replied by Joco on topic Arrays, queues and stacks
The system I have in mind is based around object properties so there should not be big performance hits due to string parsing issues.

The speed limit will be on any performance contraints caused buy accessing/manipulating object properties.

Cheers,
Joco.

Please Log in or Create an account to join the conversation.