Author |
Message |
Geg Guest
Offline
|
Posted: Wed Nov 05, 2003 4:12 pm Post subject: In there mervbot source... |
 |
|
|
|
Where is _listnode defined? Or is it something out of the project? |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Wed Nov 05, 2003 6:26 pm Post subject: |
 |
|
|
|
It's not in the DLL project, but is linked to when you try to compile. It's in datatypes.h (and cpp).
It's rather complicated if you don't have much experience with C++ so I'll try to explain here.
_listnode is a portion of a _linkedlist, which is basically like an array that can contain multiple datatypes. _linkedlists are used for the game flaglist, playerlist, and other struct lists. If you want to use one of these lists, use this:
_listnode <Datatype> *parse = list.head
while (parse)
{
Datatype *object = parse->item
//Perform functions on object
parse = parse->next
} |
Replace 'Datatype' with your desired object type (Flag, Player, Brick) and replace 'list' with your desired bot list of the data (flaglist, playerlist, bricklist).
Example on using a playerlist from Catid's rank plugin:
listnode <Player> *parse = playerlist->head;
while (parse)
{
Player *p = parse->item;
init_rank(p);
parse = parse->next;
} |
Hope this helps,
Cyan~Fire _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
 |
Geg Guest
Offline
|
Posted: Wed Nov 05, 2003 6:32 pm Post subject: |
 |
|
|
|
I know what linked lists are and how to use them, just wondering about this one . |
|
Back to top |
|
 |
Geg Guest
Offline
|
Posted: Wed Nov 05, 2003 6:35 pm Post subject: |
 |
|
|
|
Also wanted to know where to find them, and thanks. I thought I looked in there for them (seemed the most logical place, checked there first)... I seem to only be able to find the definitions in the .h file, where is the code for it at? |
|
Back to top |
|
 |
Geg Guest
Offline
|
Posted: Wed Nov 05, 2003 6:37 pm Post subject: |
 |
|
|
|
Arg, I found them.  |
|
Back to top |
|
 |
Geg Guest
Offline
|
Posted: Wed Nov 05, 2003 6:42 pm Post subject: |
 |
|
|
|
One more question, sorry. Where does AnonymousStruct come from? |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Wed Nov 05, 2003 9:53 pm Post subject: |
 |
|
|
|
AnynymousStruct is just Catid's way of saying you can put any struct in there. |
|
Back to top |
|
 |
Dustpuppy Server Help Squatter

Age:40 Gender: Joined: Jan 23 2003 Posts: 215 Location: England Offline
|
Posted: Thu Nov 06, 2003 6:25 am Post subject: |
 |
|
|
|
For some reason (not quite sure why, something to do with the templating I believe) the function bodies have to be in the header.
And yes, you can replace AnonymousStruct with whatever type you want to make a list/node of. Look up templates in the MSDN if you need more info (and have it  |
|
Back to top |
|
 |
|