Alright, here I have this small example of my complex class
class LivingObject
{
Ogre::SceneNode* myNode;
Gorilla::ScreenRenderable* myScrRend;
Gorilla::Layer* myRendLayer;
Gorilla::Rectangle* myRendRect;
int Health,Energy,Strength,Dexterity,Intelligence;
float Speed,posX,posY,posZ;
//Assortment of functions
};//Note: Specific members and functions are public/private, but is not relevant
Here is some game class info
class myGame
{
Ogre::Viewport* myViewport;//random
LivingObject LiveObjectArray[100]//question 1: holds the array of objects from a parsed file
std::vector<std::tr1::shared_ptr<LivingObject> > spawnList;//question 2
};
1) How should I be declaring LivingObject
where I can copy it later(the current method I am using gives an error: conversion from 'LivingObject*' to non-scalar type 'LivingObject' requested
)LivingObject TestObj=new LivingObject;
1a) What do I do with pointers like LivingObject::myNode
when making a new object, should I make them objects? or is something else wrong?(Note: I am using Ogre3D and this is the way that the tutorials made me set everything...)
2) When the above is solved, how would I then put it into a shared_ptr vector and access that specific element for functions(e.g. spawnList[15].(or ->)Attack(target);