[Finished] [RGSS] Method Argument Type Checking

Started by Blizzard, March 27, 2011, 05:46:21 am

Previous topic - Next topic

Blizzard

March 27, 2011, 05:46:21 am Last Edit: September 09, 2011, 06:36:55 pm by Ryex
Method Argument Type Checking




Description

All our methods so far should be changed so they have type safe arguments. Some of them already work. Whenever we use NUM2INT or INT2NUM, that is already assured, but the problem happens when we use our own classes.



Priority

Medium.



Prerequisites

None.



Assigned

Nobody



Everything else

After this task has been completed, all newly implemented methods afterwards need to have this type of type check as well.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

we can use
rb_obj_is_instance_of(VALUE obj, VALUE klass)

can't we? we just have to use the rb_cKlass objects
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

Oh, that actually works? Awesome! xD
I will put a macro together to make things easier for argument type check and automatic argument error raising.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.