Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,574 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
OOP Object Creation with Lite-C #375729
06/27/11 15:35
06/27/11 15:35
Joined: Feb 2009
Posts: 52
Rohiaw Offline OP
Junior Member
Rohiaw  Offline OP
Junior Member

Joined: Feb 2009
Posts: 52
So hey guys,
I've been having some difficulty trying to figure out how to create your own objects/classes in code.
What I want is to have an object that can be referenced by other sub data members, like when you create a class in java.
(Box class, having width and height ... bla bla bla )
Kinda also like a record variable type in pascal.
Or module in ruby.

More Detail:
What i really want is to implement a similar event system as in RPG Maker XP / VX, if any of you know what that is. My aim is to try and create common events, containing an index, name, action and dependanacy fields.

I hope i explained myself clearly laugh

Re: OOP Object Creation with Lite-C [Re: Rohiaw] #375730
06/27/11 15:40
06/27/11 15:40
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
Lite-C is not object-oriented. This means there are no classes but only structs. They are similiar to classes, but they can only hold data (like width and height), but no functions/methods. There is no private/protected/public and structs can't be derived from other structs.

http://manual.conitec.net/structs.htm

Re: OOP Object Creation with Lite-C [Re: Lukas] #375731
06/27/11 15:49
06/27/11 15:49
Joined: Jan 2011
Posts: 122
GUILIN , CHINA
tzw Offline
Member
tzw  Offline
Member

Joined: Jan 2011
Posts: 122
GUILIN , CHINA
you can use func pointers to emulate methos.and use some special ways to bind them(constructor?)
but don't think it is interesting..


Last edited by tzw; 06/27/11 15:55.

Full of my eyes are class struggles.....
Re: OOP Object Creation with Lite-C [Re: Lukas] #375732
06/27/11 15:49
06/27/11 15:49
Joined: Feb 2011
Posts: 135
Myrkling Offline
Member
Myrkling  Offline
Member

Joined: Feb 2011
Posts: 135
Rohiaw, you might be interested in

- this thread: 'Structured' programming in Lite-C

- Lite Foundation: "Lite Foundation is written in C with the purpose to extend C with the concept of classes, delegated protocols and all this fancy object oriented stuff, all in a way that allows it to easily create class instances and classes..."

Re: OOP Object Creation with Lite-C [Re: Myrkling] #375734
06/27/11 16:01
06/27/11 16:01
Joined: Feb 2009
Posts: 52
Rohiaw Offline OP
Junior Member
Rohiaw  Offline OP
Junior Member

Joined: Feb 2009
Posts: 52
thanks lukas and Myrkling. Structs were exactly the things i needed.
Just one last thing. This might sound noobish, i just want to be sure.
Can i create an array of my own struct ? i assume it can be done.

Re: OOP Object Creation with Lite-C [Re: Rohiaw] #375735
06/27/11 16:10
06/27/11 16:10
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
Yes you can.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1