Raised This Month: $12 Target: $400
 3% 

Methodmap Circular Dependency


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
clug
Junior Member
Join Date: May 2016
Location: Australia
Old 03-03-2018 , 06:21   Methodmap Circular Dependency
Reply With Quote #1

Hi guys,
I've been working on an include for some custom data structures I need that other extensions/includes don't seem to solve. However, I've hit a roadblock, as I have two methodmaps that depend on each other, and I can't seem to find a way to prototype them as I would in any other language to make it work.

Here's a slimmed down example of what I'm trying to achieve:
PHP Code:
methodmap _Array {
    public 
_Object Get_Object() { /* code here */ };
    public 
bool Set_Object(_Object value) { /* code here */ };
}

methodmap _Object {
    public 
_Array Get_Array() { /* code here */ };
    public 
bool Set_Array(_Array value) { /* code here */ };

Obviously by default it won't work, but does prototyping exist for methodmaps in Pawn? I attempted putting this at the top of the include:
PHP Code:
methodmap _Object { }
methodmap _Array { } 
So that they are visible to one another, but this just results in an error:
Code:
error 110: _Array has already been defined (previously seen as methodmap)
Any ideas?
Thanks!

Last edited by clug; 03-03-2018 at 06:23.
clug is offline
 



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 05:57.


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