Sign in to follow this  
MTclip

copying resources..?

Recommended Posts

MTclip    242
in the game i am trying to work on .. ;P I am going to have a pool or "parts" there will be one copy of every unique part in this pool... parts will include... characters, items, weapons etc.. I can get the pool set up fine.. I was just wondering the best way to go about copying the resource into another...

Share this post


Link to post
Share on other sites
Fruny    1658
We cannot answer the question without being given more information: what is the nature of those 'resources', what is the nature of that 'pool', what language are you programming in, what is the purpose of that copying (Prototype Design Pattern?)...

Share this post


Link to post
Share on other sites
MTclip    242
mmmm.. k.

its c++

All i realy wanted to know was what is the best way to take copy the infomation from a resource pool..

some thing like......

resourcePool[2] = (ITEM, "RING", 5);
resourcePool[3] = (WEAPON, "SWORD", 32);

entity[0] = resourcePool[2];
entity[1] = resourcePool[2];
entity[2] = resourcePool[3];

..where the = would place a copy of the resource..

that is the basic idea.. not exactly how it will be implemented

but i am going to look up Prototype Design Pattern..

Share this post


Link to post
Share on other sites
ToohrVyk    1595
Well, I would say you need to implement operator= for your resource objects... But without knowing (as Fruny asked) the purpose of this entire thing (keeping around a pool, copying data from it) we won't be able to give a serious solution.

Share this post


Link to post
Share on other sites

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