SA-MP Forums Archive
Lists, Vectors, ArrayLists, etc - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Plugin Development (https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: Lists, Vectors, ArrayLists, etc (/showthread.php?tid=206893)



Lists, Vectors, ArrayLists, etc - Krx17 - 04.01.2011

Has anyone ever tried to make a List or Vector plugin using STL? It could make life a lot easier for some users as they wouldn't have to deal with raw arrays. I thought about this after we were learning about ArrayLists and data structures in my Java class.


Re: Lists, Vectors, ArrayLists, etc - clum# - 04.01.2011

http://www.cppreference.com/cppvector/index.html

Also, Vectors are becoming/have become deprecated in Java.


Re: Lists, Vectors, ArrayLists, etc - Krx17 - 04.01.2011

I don't need the API for vectors. I know what they are and what they do. I'm just wondering if anybody has ever tried building a plugin utilizing vectors to make life easier on scripters.


Re: Lists, Vectors, ArrayLists, etc - pliva_sb - 04.01.2011

I made Vectors plugin for myself,but I lose it when I reinstall windows.


Re: Lists, Vectors, ArrayLists, etc - RSX - 05.01.2011

I'm using vectors in my script, and now I'll be trying to develop structure like this:
struct PLAYER{
<pdata>
};
vector<PLAYER> PlayersData;
But for now I don't see a real point linking vector into pawn, as you can't use it as real vector anyway, you could rather make a simple dynamic array, with reduced but much more efficient methods.


Re: Lists, Vectors, ArrayLists, etc - Krx17 - 05.01.2011

Well for the advanced users, I'm pretty sure they know how to make their script efficient. New users most likely always will make arrays MUCH to big and a vector or arraylist type plugin will reduce that since they don't start out so big.


Re: Lists, Vectors, ArrayLists, etc - Kyosaur - 06.01.2011

People dont really realize we already really have a dynamic array plugin. Search for incognito's gvar plugin, it has functions for storing floats,strings, and ints - all of which have an index parameter so you can create arrays.


I agree though it would be pretty awesome to see an STL plugin with the algorithms,maps,lists, and all the other cool things it has to offer.