Author Topic: (no subject)  (Read 4718 times)

AlienDude

  • Member
  • *
  • Posts: 605
    • View Profile
    • http://www.taralax.com
(no subject)
« on: April 14, 2005, 02:57:54 PM »
I ws tryin out the oop for classes and this is what i have for player stats (this is just a snippet btw):

Code: [Select]
sikhil = new(player)

kis!=sikhil->gethmax()
mwin("<kis!>")
wait()
windows()

class player
{
private:
handle$
maxhp!
hp!
maxsp!
sp!
str!
def!
dex!
int!
wis!
agi!
status[]! //status effects affecting players
eq[6]$ //equip slots

public:
method player()
method ~player()
method gethmax() {return this->maxhp!}
method getsmax() {return this->maxsp!}
method gethp() {return hp!}
method sethp(x!)
method sethp(dir$)
method getstat(stat$)
method seapp(se!)
method sedel(se!)
method equip(slot!, item$)
method unequip(slot!, item$)
method levelup()
}

method player::player()
{
str!=16
def!=16
dex!=16
int!=16
wis!=16
agi!=16
maxhp!=46
hp!=46
maxsp!=34
sp!=34
}

method player::~player() {}
method player::player(pstat!)
{
str!=pstat!
def!=pstat!
dex!=pstat!
int!=pstat!
wis!=pstat!
agi!=pstat!
}
method player::gethmax() {return this->maxhp!}
method player::getsmax() {return this->maxsp!}
[snip]


the gethmax() call came up "0" wtf is wrong,
oh all the methods are defined in the program

doyou have to have the public part before the private part, which is weird, why now just use teh same form as in c++?
« Last Edit: December 31, 1969, 06:00:00 PM by AlienDude »
Quote
May your star always be good to you and may your travels be swift.
 
- Traveller Farewell
(adapted from the Necroscope series by Brian Lumley)

Taralax Studios BEING REBUILT GENOME BY GENOME! Wink. C++ even shows that pointers are becoming less liked by providing safer references, and encouraging the use of the STL's classes like 'string' as opposed to pointers to char arrays for strings. I guess the folks at ISO and ANSI are a bunch of newbs, heh.
« Last Edit: April 16, 2005, 01:02:06 PM by Colin »
— Colin

AlienDude

  • Member
  • *
  • Posts: 605
    • View Profile
    • http://www.taralax.com
(no subject)
« Reply #9 on: April 16, 2005, 01:10:25 PM »
i KNOW the danger the possibility of incorrect pointers are!!!!!

and i was just seeing if it was POSSIBLE!!!!!  NOT EVIL OR GOOD OR TYPE SAFE!!!

it is faster that standard array indexing itested myself!!!

and again, when i am very fluent in the language and maybe a couple of others, i will be helping out.  In fact im getting the 0.6 source on monday so i can help out and examine this masterpiece.

another question: is canvassing fully inplemented now or do you have to use plugins for it to have access to all the canvassing commands?  there are no blitting commands unless they're cloaked in other commands.  You even said before yourself that they weren't.

but i do have to say this, despite all this you guys did a stellar job on 3.0.6!!!  i wanted to make that clear.  Smile  two thumbs up!!!
« Last Edit: December 31, 1969, 06:00:00 PM by AlienDude »
Quote
May your star always be good to you and may your travels be swift.
 
- Traveller Farewell
(adapted from the Necroscope series by Brian Lumley)

Taralax Studios BEING REBUILT GENOME BY GENOME! \n\t\t\t\t\t\t\t\t\t
<' + '/div>\n\t\t\t\t\t\t\t\t\t