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

Object Oriented module?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 04-28-2004 , 10:51   Object Oriented module?
Reply With Quote #1

Would it be hard to create a module that would allow use to use classes in SC?
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
BAILOPAN
Join Date: Jan 2004
Old 04-28-2004 , 11:47  
Reply With Quote #2

Describe how you would want it to work
__________________
egg
BAILOPAN is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 04-28-2004 , 12:06  
Reply With Quote #3

that could be nice
like a function register_class(const name[]), which would return an id; then register_classvar(const class[], const name[]), which would register a variable for that class, register_classfunc(const class[], const pubFuncName[]), then create_classinstance(classId), delete_classinstance(instance), get_classvar(instance, const varName[]), set_classvar(instance, const varName[], value), and something like call_classfunc

Just a few ideas
__________________
hello, i am pm
PM is offline
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 04-28-2004 , 12:42  
Reply With Quote #4

and what whould that be good for
__________________
My Plugins

Got ??
AssKicR is offline
BAILOPAN
Join Date: Jan 2004
Old 04-28-2004 , 12:44  
Reply With Quote #5

Small is a very limited language. Adding support for higher level programming concepts is fairly useless, as well as interesting.
__________________
egg
BAILOPAN is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 04-30-2004 , 10:53  
Reply With Quote #6

I dunno, I would just like the though of when a player joins, creating a player object.

That would say contain, player kills, damage, etc...

I do realize I can just use arrays, I'd just like to do some OO stuff
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Downtown1
Veteran Member
Join Date: Mar 2004
Old 05-09-2004 , 22:46  
Reply With Quote #7

Nested objects .

player.gun.ammoCount;

or

class newGun extend gun {
//make a new gun from the old gun here
}

Would be cool
Downtown1 is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 05-10-2004 , 01:06  
Reply With Quote #8

Maybe when I get into more indepth c++ in school I'll try to do this myself, i'm not too familiar with adding something like that as a module.
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Downtown1
Veteran Member
Join Date: Mar 2004
Old 06-03-2004 , 22:37  
Reply With Quote #9

This would be a great idea if we could have tons of native objects like in JavaScript .
Downtown1 is offline
BAILOPAN
Join Date: Jan 2004
Old 06-03-2004 , 23:24  
Reply With Quote #10

Sure go ahead and add it.

Since Small is simply an implementation of the AMX format, feel free to just tack it on to the compiler:
Source code.

Note my sarcasm: this could take months to do, the benefits are very small. At best it would be a functional level abstraction layer, like:
new class = register_class("Name")
add_member(class, "__constructor")
...
new example = class("Name")
class_exec(example, "member", ...)
...etc
because that's easier. Adding something simple like structs means you have to redesign the language. Open the compiler source and ask me if you want to undertake that. Hint: the compiler is written in pure C, so you OOP yuppies can have fun
__________________
egg
BAILOPAN is offline
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 00:18.


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