Quote:
Originally Posted by Avalion
I wanted to use the stl. I am not too sure if I actually tested using xRandom or not but for those using compilers that are not C++11 can try using xRandom as a replacement.
|
rand() is neither STL nor C++11, it's from the old & good C times...
And you presumably don't mean STL but the C++ standard library, there is a major difference between the two of them.
The code looks like what I'd expect from a casual flyff programmer, no const correctness and a singleton definition. I don't like the way you return a pointer to data of a vector, the whole address space of the content of a vector can change by adding new items to it, other than that it's even more efficient storing pointers in it, but the C++ and pointers thing is a whole new story anyway, since no real C++ programmer would recommend using pointers and manual memory management at all, they would do some reference sorcery, like checking first of all whether the item exists and afterwards they'd get a const reference to it.
From the flyff point of view though the code looks ok, one can really see it's much influenced by the shit created by the original authors. From time to time you differ from the actual naming convention, though, like prefixing a non-pointer object with p, which really is confusing for others working with the code.