Extended arraylist
Hello
For my purposes I need structure something like own arraylist with additional variables and i wondering how to obtain this goal. Normally I would use enum and then array of enums, but is there any other better way? ArrayList g_Zoo = new ArrayList(SIZE); -g_Zoo[0] ---char[] name ---char[] description ---int years ---ArrayList animals -g_Zoo[1] ---char[] name2 ---char[] description2 ---int years2 ---ArrayList animals2 ... -g_Zoo[SIZE-1] ---char[] nameSIZE-1 ---char[] descriptionSIZE-1 ---int yearsSIZE-1 ---ArrayList animalsSIZE-1 etc.. Any ideas? |
Re: Extended arraylist
An arraylist of datapacks maybe?
|
Re: Extended arraylist
SourcePawn can't do that unfortunately. Use Dynamic! https://forums.alliedmods.net/showthread.php?t=270519
|
Re: Extended arraylist
Something like this?
zoo.inc: PHP Code:
PHP Code:
|
Re: Extended arraylist
Quote:
|
Re: Extended arraylist
You can indeed do this using a single ArrayList with a suitably large blocksize, but some helper functions would be required as GetString can't take a starting offset.
|
Re: Extended arraylist
An example of Dynamic...
Using the class builder I created this methodmap. Code:
#if defined _dynamic_class_zoo_ Code:
#include <sourcemod> |
All times are GMT -4. The time now is 20:56. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.