Raised This Month: $66 Target: $400
 16% 

Module: Vdf (key/value trees) - 1.07


Post New Thread Reply   
 
Thread Tools Display Modes
Zenith77
Veteran Member
Join Date: Aug 2005
Old 02-24-2007 , 19:02   Re: Module: Vdf trees
Reply With Quote #11

Sounds cool ^^. But are you adding the natives or no (sounds like you are, but didn't get an answer :-))
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
commonbullet
Veteran Member
Join Date: Oct 2005
Old 02-24-2007 , 19:51   Re: Module: Vdf trees
Reply With Quote #12

I guess I'll include this form:
Code:
vdf_is_first_node(node);
vdf_is_last_node(node);
actually, they could be easily replaced with these existent functions
Code:
!vdf_get_previous_node(node) // if true that's first node
!vdf_get_next_node(node) // if true that's the last node
but I guess the former sounds clearer.

And I'll include another one to way to count nodes in a branch. Maybe you can help me to find a better name to that.
Code:
vdf_count_branch_nodes(node)

Last edited by commonbullet; 02-24-2007 at 19:56.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
Zenith77
Veteran Member
Join Date: Aug 2005
Old 02-25-2007 , 11:13   Re: Module: Vdf trees
Reply With Quote #13

vdf_num_branch_nodes() lol?
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
commonbullet
Veteran Member
Join Date: Oct 2005
Old 02-25-2007 , 15:04   Re: Module: Vdf trees - 1.01
Reply With Quote #14

Update:

- updated sdk files and included auto load feature.
- nodes and trees are now pointers (thus should be used carefully)
- included the following natives.
Code:
vdf_set_node_key(node, const key[]);
vdf_set_node_value(node, const value[]);
native vdf_count_branch_nodes(node);
vdf_remove_tree(vdftree)
- included these stocks as suggested by Zenith
Code:
vdf_is_last_node(node)
vdf_is_first_node(node)

- The number of arguments of many natives has changed.
- Included a more consistent example – it covers almost all features - creatings a trees, saving, reading from file, representing trees structures in a menu interface.
I’ve spammed this example with comments as so to make it clear for everyone (not only for more experienced coders).

Thanks to Bail, Rukia, sawce and Zenith for helping me to improve it.

Last edited by commonbullet; 02-25-2007 at 15:53.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
Zenith77
Veteran Member
Join Date: Aug 2005
Old 02-25-2007 , 15:44   Re: Module: Vdf trees - 1.01
Reply With Quote #15

Yay. I love all these modules coming out (this and MemoryX). They've been a great aid to me :-).
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
commonbullet
Veteran Member
Join Date: Oct 2005
Old 03-01-2007 , 20:16   Re: Module: Vdf trees - 1.02
Reply With Quote #16

Update 1.02

- Included new search natives:
Code:

// creates a new search
vdf_create_search();

// sets up search
vdf_set_search(search, tree, const searchstr[], searchtype = 0, level =-1, ignorecase = 0);

// finds next node that matches search
vdf_find_next_match(search, startnode = 0); 

// closes search
vdf_close_search(search);
- Included this native for fast checking node depth:
Code:
native vdf_get_node_level(node);
- Detailed documentation in vdf.inc

- Included a plugin example for searching

- Fixed tree structure would be wrongly formed if vdf used k&r indentation style.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
Zenith77
Veteran Member
Join Date: Aug 2005
Old 03-01-2007 , 23:25   Re: Module: Vdf trees - 1.02
Reply With Quote #17

Yay.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
commonbullet
Veteran Member
Join Date: Oct 2005
Old 04-07-2007 , 16:09   Re: Module: Vdf trees - 1.03
Reply With Quote #18

1.03 Update

Lots of new stuff + fixes:

- It now requires tags for trees, nodes, and search. It tends to get safer from mistakes that could cause crashes, and it makes the source in pawn more clear (I think).
They are: VdfTree, VdfNode, VdfSearch; check the examples.

- Search may perform entire tree scanning by setting "*" as the look up string (this feature is useful to parse stuff).
- New find_in_branch native to look up a node in a branch
- New ‘shell’ sort nodes native, vdf_sort_branch. Sorts might be performed to nodes based on key/values (as strings or as numbers).
- New move nodes native (only moves nodes that are in the same tree): vdf_move_to_branch, vdf_move_as_child

- Included some ‘sugar’ to make it easier to lazy coders like me:
- vdf_get_node_value_num, vdf_get_node_value_float, vdf_get_node_value_vector – value string are converted to these ‘types’.
- vdf_set_node_value_num, vdf_set_node_value_float, vdf_set_node_value_vector – converts these ‘types’ to a string and stores in node value.

- Fixed append node bug, and some minor stuff.

Thanks to sawce for helping me with the code and for the Linux build.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
commonbullet
Veteran Member
Join Date: Oct 2005
Old 04-16-2007 , 01:30   Re: Module: Vdf trees - 1.03a
Reply With Quote #19

Update 1.03a

- fixed find_in_branch - didn't work, I'd forgotten to include in table
- fixed vdf_save, vdf_create wouldn't get the correct path from mod directory

I saw a "daily mapcycle" request in forums suggestions and decided to include a vdf version of this in examples.

Last edited by commonbullet; 04-16-2007 at 01:39.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
commonbullet
Veteran Member
Join Date: Oct 2005
Old 06-03-2007 , 02:24   Re: Module: Vdf trees - 1.03a
Reply With Quote #20

There's a bug in the linux version. Since I'm planning to release a new version soon, I'm posting a fix here.

Thanks to Zenith77 for reporting that and sawce for telling me how to debug it in Linux.

EDIT: Old attachment removed.

Last edited by commonbullet; 06-06-2007 at 21:22.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:52.


Powered by vBulletin®
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Theme made by Freecode