Raised This Month: $ Target: $400
 0% 

Concept: Project base


Post New Thread Reply   
 
Thread Tools Display Modes
FaTony
Veteran Member
Join Date: Aug 2008
Old 11-16-2010 , 15:07   Re: Concept: Project base
Reply With Quote #41

PHP Code:
enum MyClass
{
   
member;
   
Float:anotherone;
};

stock MyClass_MyFunction(&MyClass:thisstuff); 
__________________
FaTony is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 11-16-2010 , 17:53   Re: Concept: Project base
Reply With Quote #42

Quote:
Originally Posted by FaTony View Post
PHP Code:
enum MyClass
{
   
member;
   
Float:anotherone;
};

stock MyClass_MyFunction(&MyClass:thisstuff); 
I think you're mixing the concepts of enum and the Pawn "object". Proper way to do what would be:
Code:
stock MyClass_MyFunction(this[MyClass], stuff);
Seta00 is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 11-16-2010 , 18:25   Re: Concept: Project base
Reply With Quote #43

Instead of handling object simulation in SourcePawn, it might be better to do it through an extension. Then you can do real objects.

That would be a interesting project! Plugins could define data structures through the extension natives and then tell it to make objects and even collections/lists of them. The plugin will then have access to data in these individual objects through handles of various types.

In addition this base plugin would be better as an extension because of the more powerful C++ language.

How cool would that be?
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 11-16-2010 , 18:53   Re: Concept: Project base
Reply With Quote #44

Not as cool as Knight
Seta00 is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 11-16-2010 , 19:11   Re: Concept: Project base
Reply With Quote #45

Well I don't know about its progress, but yes, a better scripting language would be cool too.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
Chanz
Veteran Member
Join Date: Aug 2008
Location: Germany - Stuttgart
Old 11-16-2010 , 19:21   Re: Concept: Project base
Reply With Quote #46

yeah lets take the whip out and tell bail to work harder better faster stronger. :-)

No srlsy, Seta00 you made me remember how awesome Knight will be. Now I dunno: should I wait for Knight or continue with pawn...
__________________
[ SourceModPlugins.org ][ My Plugins ]

Thank you for donations: [ Paypal ]

Video Tutorial (German): [ Gameserver & SourceMod Plugins mit HLSW verwalten ]
Chanz is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 11-17-2010 , 08:39   Re: Concept: Project base
Reply With Quote #47

I've split the whole SourcePawn vs. C++ debate over to a new thread.
Let's keep this one related to the Project Base idea.
__________________
asherkin is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 11-17-2010 , 10:21   Re: Concept: Project base
Reply With Quote #48

Well it was in fact partly on topic, because this base is well suited as an extension too. Using this base is a good example of SourcePawn vs. C++.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
FaTony
Veteran Member
Join Date: Aug 2008
Old 12-29-2010 , 15:09   Re: Concept: Project base
Reply With Quote #49

Well I actually got around emulating oop in SP. You declare each class as a separate inc, declate it's member variables as statics and private member functions as statics too. Works very well. If your class is a singleton your keep data as global statics. Else you store all data in enum and design your functions with "this[classname]" agrument. I prefer Classname_FunctionName convention.
__________________

Last edited by FaTony; 12-29-2010 at 15:14.
FaTony is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 12-29-2010 , 15:31   Re: Concept: Project base
Reply With Quote #50

Interesting. Do you have any examples on how to use these "objects" and multiple instances of objects?
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
Reply



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 17:28.


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